---
sourceDocument: Xanadu API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# NotifyAction - Global

# NotifyAction - Global {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 22 minutes to read

The NotifyAction API allows you to define actions to send to a
telephony provider.

You add actions to a NotifyAction object by calling the respective add function for each type of action. Each add function returns an Action object, such as a SayAction object for the addSay() method. Refer to
each method example for information about returned objects.  
Note:  
The NotifyAction API is only valid within global applications. To utilize this type of functionality within scoped applications, you must create custom Notify workflow activities. For additional information on creating these activities, see [Notify workflow activities](https://www.servicenow.com/docs/access?context=c_NotifyActivities&version=xanadu&pubname=xanadu-servicenow-platform&ft:locale=en-US).

## NotifyAction - addConference() {#ariaid-title2}

Adds a conference action to move the current call into the current conference
call.
{#r_NotifyAction-addConference__table_ef5_xg4_wr__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 1. Parameters]

{#r_NotifyAction-addConference__table_ef5_xg4_wr} {#r_NotifyAction-addConference__table_ff5_xg4_wr__entry__2}

| Type | Description |
|-|-|
| ConferenceAction | Action added to the NotifyAction object. Use the ConferenceAction object to define the conference call name, and the behavior of the conference call when a participant joins or leaves. |
[Table 2. Returns]

{#r_NotifyAction-addConference__table_ff5_xg4_wr}  
This example demonstrates how to add a conference action and set the name of the
conference.

    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();

    // add a conference call action and set its name
    var conference = notifyAction.addConference();
    conference.setName('Brown Bag: Week 3');

## NotifyAction - addConference.setEndOnExit(Boolean endOnExit) {#ariaid-title3}

Defines whether the conference call should end when a specified caller exits the
conference call.
{#NotifyAction-addConference_setEndOnExit_B__table_j33_tmc_cgb__entry__3}

| Name | Type | Description |
|-|-|-|
| endOnExit | Boolean | Flag that indicates whether the conference call should end when the specified caller exits the current conference call. * true: end the conference call when the specified caller exits the conference call * false: Default. End the conference call once all participants exit {#NotifyAction-addConference_setEndOnExit_B__ul_bcw_4fc_cgb} |
[Table 3. Parameters]

{#NotifyAction-addConference_setEndOnExit_B__table_j33_tmc_cgb} {#NotifyAction-addConference_setEndOnExit_B__table_k33_tmc_cgb__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 4. Returns]

{#NotifyAction-addConference_setEndOnExit_B__table_k33_tmc_cgb}  
This example demonstrates how to add a conference call action and then set it so the
conference call ends when the specified caller exits.

    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();

    // add a conference call action and set the caller that starts the meeting
    var conference = notifyAction.addConference();

    // retrieve the participant for which the conference call should exit when they leave
    var notifyParticipantGr = new GlideRecord('notify_participant');
    notifyParticipantGr.get('active participant sys id');
     
    if (notifyParticipantGr.isValid) {
    conference.setEndOnExit(true);
    }

## NotifyAction - addConference.setHangupOnStar(Boolean hangupOnStar) {#ariaid-title4}

Defines whether the conference call should end when a participant presses the star (\*)
key.
{#NotifyAction-addConference_setHangupOnStar_B__table_kjb_jkc_cgb__entry__3}

| Name | Type | Description |
|-|-|-|
| hangupOnStar | Boolean | Flag that indicates whether the conference call should end when a participant presses the star (\*) key. Valid values: * true: end the conference call * false: Default. Don't end the conference call {#NotifyAction-addConference_setHangupOnStar_B__ul_bcw_4fc_cgb} |
[Table 5. Parameters]

{#NotifyAction-addConference_setHangupOnStar_B__table_kjb_jkc_cgb} {#NotifyAction-addConference_setHangupOnStar_B__table_ljb_jkc_cgb__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 6. Returns]

{#NotifyAction-addConference_setHangupOnStar_B__table_ljb_jkc_cgb}  
This example demonstrates how to add a conference action and then record the conference
call.

    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();

    // add a conference call action and set the hang up action
    var conference = notifyAction.addConference();
    conference.setHangupOnStar(true);

## NotifyAction - addConference.setMuted(Boolean muted) {#ariaid-title5}

Defines whether the specified caller should be muted in the current conference
call.
If you do not call this method, the caller is not muted by default.
{#NotifyAction-addConference_setMuted_B__table_zws_qgc_cgb__entry__3}

| Name | Type | Description |
|-|-|-|
| muted | Boolean | Flag that indicates whether the specified caller should be muted in the current conference call. * true: caller should be muted * false: Default. Caller should not be muted {#NotifyAction-addConference_setMuted_B__ul_bcw_4fc_cgb} |
[Table 7. Parameters]

{#NotifyAction-addConference_setMuted_B__table_zws_qgc_cgb} {#NotifyAction-addConference_setMuted_B__table_axs_qgc_cgb__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 8. Returns]

{#NotifyAction-addConference_setMuted_B__table_axs_qgc_cgb}  
This example demonstrates how to add a conference action and then mute a specified
caller.

    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();

    // add a conference call action and set it to mute the specified participant
    var conference = notifyAction.addConference();

    var notifyParticipantGr = new GlideRecord('notify_participant');
    notifyParticipantGr.get('active participant sys id');
     
    if (notifyParticipantGr.isValid) {
    conference.setMuted(true);
    }

## NotifyAction - addConference.setName(String name) {#ariaid-title6}

Sets the name of the current conference call to the specified name.
{#NotifyAction-addConference_setName_S__table_okj_rcc_cgb__entry__3}

| Name | Type | Description |
|-|-|-|
| name | String | Name to associate with the current conference call. |
[Table 9. Parameters]

{#NotifyAction-addConference_setName_S__table_okj_rcc_cgb} {#NotifyAction-addConference_setName_S__table_pkj_rcc_cgb__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 10. Returns]

{#NotifyAction-addConference_setName_S__table_pkj_rcc_cgb}  
This example demonstrates how to add a conference action and set the name of the conference
call.

    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();

    // add a conference call action and set its name
    var conference = notifyAction.addConference();

    conference.setName('Brown Bag: Week 3');

## NotifyAction - addConference.setRecord(Boolean record) {#ariaid-title7}

Defines whether the associated conference call should be recorded.
If you do not call this method, the conference call is not recorded by default.
{#NotifyAction-addConference_setRecord_B__table_bz2_ffc_cgb__entry__3}

| Name | Type | Description |
|-|-|-|
| record | Boolean | Flag that indicates whether the current conference call should be recorded. * true: start recording the conference call * false: Default. Conference call is not recorded. Recording is stopped if it is currently being recorded. {#NotifyAction-addConference_setRecord_B__ul_bcw_4fc_cgb} |
[Table 11. Parameters]

{#NotifyAction-addConference_setRecord_B__table_bz2_ffc_cgb} {#NotifyAction-addConference_setRecord_B__table_cz2_ffc_cgb__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 12. Returns]

{#NotifyAction-addConference_setRecord_B__table_cz2_ffc_cgb}  
This example demonstrates how to add a conference action and then record the conference
call.

    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();

    // add a conference call action and set it to be recorded
    var conference = notifyAction.addConference();
    conference.setRecord(true);

## NotifyAction - addConference.setStartOnEnter(Boolean startOnEnter) {#ariaid-title8}

Defines whether the conference call should start when the specified caller joins the
conference call.
By default, whenever there are two or more callers, the conference call starts. To make it
so the conference call only starts when a specific caller joins, you must call this method
for each of the other callers and set the value to "false". By doing this, the conference
call will not start until the desired person joins the conference call.
{#NotifyAction-addConference_setStartOnEnter_B__table_dps_43c_cgb__entry__3}

| Name | Type | Description |
|-|-|-|
| startOnEnter | Boolean | Flag that indicates whether the conference call should start when the selected caller joins the current conference call. * true: Default. Start the conference call when the specified caller joins the conference call. * false: start the conference call once it is added {#NotifyAction-addConference_setStartOnEnter_B__ul_bcw_4fc_cgb} |
[Table 13. Parameters]

{#NotifyAction-addConference_setStartOnEnter_B__table_dps_43c_cgb} {#NotifyAction-addConference_setStartOnEnter_B__table_eps_43c_cgb__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 14. Returns]

{#NotifyAction-addConference_setStartOnEnter_B__table_eps_43c_cgb}  
This example demonstrates how to add a conference action and then set it so the conference
call does not start until the specified caller joins.

    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();

    // add a conference call action and set the caller that starts the meeting
    var conference = notifyAction.addConference();

    // retrieve the participant for which the conference call should start when they arrive
    var notifyParticipantGr = new GlideRecord('notify_participant');
    notifyParticipantGr.get('active participant sys id');
     
    if (notifyParticipantGr.isValid) {
    conference.setStartOnEnter(true);
    }

## NotifyAction - addDial() {#ariaid-title9}

Forwards a call to a specified phone number or Notify Client.
Once the addDial action is created, the associated phone number
(setPhoneNumber()) or Notify Client
(setClientRecord()) must also be set.
{#r_NotifyAction-addDial__table_ef5_xg4_wr__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 15. Parameters]

{#r_NotifyAction-addDial__table_ef5_xg4_wr} {#r_NotifyAction-addDial__table_ff5_xg4_wr__entry__2}

| Type | Description |
|-|-|
| DialAction | Action added to the NotifyAction object. |
[Table 16. Returns]

{#r_NotifyAction-addDial__table_ff5_xg4_wr}  
This example shows how to make an outbound call and record the call.

    // Initialize NotifyAction
    var notifyAction = new SNC.NotifyAction();
     
    // Call addDial() to connect to another party -- this returns an object of type DialAction
    var dialAction = notifyAction.addDial();
     
    // Call setPhoneNumber(String phoneNumber)in DialAction.java to specify the phone number to dial
    dialAction.setPhoneNumber('+919765xxxxxxx');
     
    // Invoke setRecord(Boolean record) to record the call to this new number +919765xxxxxxx
    dialAction.setRecord(true);

## NotifyAction - addDial.setCallerID(String callerID) {#ariaid-title10}

Defines the caller ID for the outgoing call.
{#NotifyAction-addDial_setCallerID_S__table_ehj_hzc_cgb__entry__3}

| Name | Type | Description |
|-|-|-|
| callerID | String | Caller identifier to set for the outgoing call. |
[Table 17. Parameters]

{#NotifyAction-addDial_setCallerID_S__table_ehj_hzc_cgb} {#NotifyAction-addDial_setCallerID_S__table_fhj_hzc_cgb__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 18. Returns]

{#NotifyAction-addDial_setCallerID_S__table_fhj_hzc_cgb}  
This example shows how to make an outbound call and set a call timeout.

    // Initialize NotifyAction
    var notifyAction = new SNC.NotifyAction();
     
    // Call addDial() to connect to another party -- this returns an object of type DialAction
    var dialAction = notifyAction.addDial();
     
    // Call setPhoneNumber(String phoneNumber)in DialAction.java to specify the phone number to dial
    dialAction.setPhoneNumber('+919765xxxxxxx');
     
    // Set the caller ID
    dialAction.setCallerID('Planning Conf Call');

## NotifyAction - addDial.setClientRecord(String tableName, String sysID) {#ariaid-title11}

Sets the current caller to a Notify caller by specifying the table in which to find the
Notify caller record and the caller's unique identifier.
{#NotifyAction-addDial_setClientRecord_S_S__table_mmn_zbd_cgb__entry__3}

| Name | Type | Description |
|-|-|-|
| tableName | String | Name of the table that contains the desired caller's information. |
| sysID | String | Unique identifier (sys_id) of the desired Notify caller. |
[Table 19. Parameters]

{#NotifyAction-addDial_setClientRecord_S_S__table_mmn_zbd_cgb} {#NotifyAction-addDial_setClientRecord_S_S__table_nmn_zbd_cgb__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 20. Returns]

{#NotifyAction-addDial_setClientRecord_S_S__table_nmn_zbd_cgb}  
This example shows how to set the current caller to a Notify caller using
setClientRecord().

    // set up a dial action to forward the
    // call to the specified client
    var action = new SNC.NotifyAction();
    var dial = action.addDial();
    dial.setClientRecord(notifyClientRecord.getTableName(), notifyClientRecord.getUniqueValue());
    dial.setTimeout(activity.vars.timeout);
    dial.setRecord(activity.vars.record);

## NotifyAction - addDial.setDTMF(String value) {#ariaid-title12}

Defines the DTMF tones to play when the call connects.
{#NotifyAction-addDial_setDTMF_S__table_ult_2fd_cgb__entry__3}

| Name | Type | Description |
|-|-|-|
| value | String | Valid DTMF digits to play when the call connects. |
[Table 21. Parameters]

{#NotifyAction-addDial_setDTMF_S__table_ult_2fd_cgb} {#NotifyAction-addDial_setDTMF_S__table_vlt_2fd_cgb__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 22. Returns]

{#NotifyAction-addDial_setDTMF_S__table_vlt_2fd_cgb}  
This example shows how to make an outbound call and defines the DTMF tones to play when the
call connects.

    // Initialize NotifyAction
    var notifyAction = new SNC.NotifyAction();
     
    // Call addDial() to connect to another party - this returns an object of type DialAction
    var dialAction = notifyAction.addDial();
     
    // Call setPhoneNumber(String phoneNumber)in DialAction.java to specify the phone number to dial
    dialAction.setPhoneNumber('+919765xxxxxxx');
     
    // DTMF tones to play when call connects
    dialAction.setDTMF("1246AF");

## NotifyAction - addDial.setHangupOnStar(Boolean hangupOnStar) {#ariaid-title13}

Defines whether the call should end when the star (\*) key is pressed.
{#NotifyAction-addDial_setHangupOnStar_B__table_uns_2gd_cgb__entry__3}

| Name | Type | Description |
|-|-|-|
| hangupOnStar | Boolean | Flag that indicates whether the call should end when the star (\*) key is pressed. * true: end the call * false: don't end the call {#NotifyAction-addDial_setHangupOnStar_B__ul_bcw_4fc_cgb} |
[Table 23. Parameters]

{#NotifyAction-addDial_setHangupOnStar_B__table_uns_2gd_cgb} {#NotifyAction-addDial_setHangupOnStar_B__table_vns_2gd_cgb__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 24. Returns]

{#NotifyAction-addDial_setHangupOnStar_B__table_vns_2gd_cgb}  
This example shows how to make an outbound call and set the hang up key to star.

    // Initialize NotifyAction
    var notifyAction = new SNC.NotifyAction();
     
    // Call addDial() to connect to another party -- this returns an object of type DialAction
    var dialAction = notifyAction.addDial();
     
    // Call setPhoneNumber(String phoneNumber)in DialAction.java to specify the phone number to dial
    dialAction.setPhoneNumber('+919765xxxxxxx');
     
    // End call by pressing star
    dialAction.setHangupOnStar(true);

## NotifyAction - addDial.setPhoneNumber(String phoneNumber) {#ariaid-title14}

Defines the phone number to call.
{#NotifyAction-addDial_setPhoneNumber_S__table_cdc_f1d_cgb__entry__3}

| Name | Type | Description |
|-|-|-|
| phoneNumber | String | E.164-compliant phone number to call. |
[Table 25. Parameters]

{#NotifyAction-addDial_setPhoneNumber_S__table_cdc_f1d_cgb} {#NotifyAction-addDial_setPhoneNumber_S__table_ddc_f1d_cgb__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 26. Returns]

{#NotifyAction-addDial_setPhoneNumber_S__table_ddc_f1d_cgb}  
This example shows how to make an outbound call and set a call timeout.

    // Initialize NotifyAction
    var notifyAction = new SNC.NotifyAction();
     
    // Call addDial() to connect to another party -- this returns an object of type DialAction
    var dialAction = notifyAction.addDial();
     
    // Call setPhoneNumber(String phoneNumber)in DialAction.java to specify the phone number to dial
    dialAction.setPhoneNumber('+919765xxxxxxx');

## NotifyAction - addDial.setRecord(Boolean record) {#ariaid-title15}

Defines whether the outgoing call should be recorded.
{#NotifyAction-addDial_setRecord_B__table_hbp_sdd_cgb__entry__3}

| Name | Type | Description |
|-|-|-|
| record |   | Flag that indicates whether the outgoing call should be recorded. Valid values: * true: record the outgoing call * false: do not record the outgoing call {#NotifyAction-addDial_setRecord_B__ul_z5r_22d_cgb} |
[Table 27. Parameters]

{#NotifyAction-addDial_setRecord_B__table_hbp_sdd_cgb} {#NotifyAction-addDial_setRecord_B__table_ibp_sdd_cgb__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 28. Returns]

{#NotifyAction-addDial_setRecord_B__table_ibp_sdd_cgb}  
This example shows how to make an outbound call and record the call.

    // Initialize NotifyAction
    var notifyAction = new SNC.NotifyAction();
     
    // Call addDial() to connect to another party -- this returns an object of type DialAction
    var dialAction = notifyAction.addDial();
     
    // Call setPhoneNumber(String phoneNumber)in DialAction.java to specify the phone number to dial
    dialAction.setPhoneNumber('+919765xxxxxxx');
     
    // Record the call
    dialAction.setRecord(true);

## NotifyAction - addDial.setTimeout(Integer timeout) {#ariaid-title16}

Sets the number of seconds after which the outgoing call times out.
{#NotifyAction-addDial_setTimeout_I__table_ldb_hyc_cgb__entry__3}

| Name | Type | Description |
|-|-|-|
| timeout | Integer | Number of seconds after which the outgoing call times out. Default: 30 |
[Table 29. Parameters]

{#NotifyAction-addDial_setTimeout_I__table_ldb_hyc_cgb} {#NotifyAction-addDial_setTimeout_I__table_mdb_hyc_cgb__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 30. Returns]

{#NotifyAction-addDial_setTimeout_I__table_mdb_hyc_cgb}  
This example shows how to make an outbound call and set a call timeout.

    // Initialize NotifyAction
    var notifyAction = new SNC.NotifyAction();
     
    // Call addDial() to connect to another party -- this returns an object of type DialAction
    var dialAction = notifyAction.addDial();
     
    // Call setPhoneNumber(String phoneNumber)in DialAction.java to specify the phone number to dial
    dialAction.setPhoneNumber('+919765xxxxxxx');
     
    // Set the number of seconds to wait before timing out
    dialAction.setTimeout(45);

## NotifyAction - addGather() {#ariaid-title17}

Presents a specified interactive phone menu to the caller.
{#r_NotifyAction-addGather__table_crt_zg4_wr__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 31. Parameters]

{#r_NotifyAction-addGather__table_crt_zg4_wr} {#r_NotifyAction-addGather__table_drt_zg4_wr__entry__2}

| Type | Description |
|-|-|
| GatherAction | Action added to the NotifyAction object. Use the GatherAction object to define the menu settings and options to present to the user. |
[Table 32. Returns]

{#r_NotifyAction-addGather__table_drt_zg4_wr}  

    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();

    // present the user with a menu
    var gather = notifyAction.addGather();
    gather.setNumberOfDigits(1);    // the user can type 1 digit
    gather.setFinishKey('#');       // # or *, useful for > 1 digit
    gather.setTimeout(10);          // time to enter answer, in seconds

    // add first menu item
    var usSay = gather.addSay();
    usSay.setText('Press 1 for english');
    usSay.setLanguage('en-US');

    // add second menu item
    var nlSay = gather.addSay();
    nlSay.setText('Kies 2 voor Nederlands');
    nlSay.setLanguage('nl-NL');

    // add third menu item
    var frSay = gather.addSay();
    frSay.setText('Choisissez 3 pour le français.');
    frSay.setLanguage('fr-FR');

    // and finish off with an applause
    var play = gather.addPlay();
    play.setURL('http://www.wavsource.com/snds_2015-04-12_5971820382841326/sfx/applause_y.wav');

## NotifyAction - addGather.addPlay() {#ariaid-title18}

Plays an audio file on the call.
Refer to the NotifyAction addPlay() method for a description of the
supported child methods.
{#NotifyAction-addGather_addPlay__table_uhd_mpd_cgb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 33. Parameters]

{#NotifyAction-addGather_addPlay__table_uhd_mpd_cgb} {#NotifyAction-addGather_addPlay__table_vhd_mpd_cgb__entry__2}

| Type | Description |
|-|-|
| PlayAction | Action added to the NotifyAction object. Use the PlayAction object to define the audio file URL and the number of times to loop the audio. |
[Table 34. Returns]

{#NotifyAction-addGather_addPlay__table_vhd_mpd_cgb}  

    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();

    // Create the gather action object
    var gather = notifyAction.addGather();

    // Play an audio file
    var play = gather.addPlay();
    play.setURL('http://www.wavsource.com/snds_2015-04-12_5971820382841326/sfx/applause_y.wav');

## NotifyAction - addGather.addSay() {#ariaid-title19}

Defines the text-to-speech to read on the call.
Refer to the NotifyAction addSay() method for a description of the
supported child methods.
{#NotifyAction-addGather_addSay__table_cp4_znd_cgb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 35. Parameters]

{#NotifyAction-addGather_addSay__table_cp4_znd_cgb} {#NotifyAction-addGather_addSay__table_dp4_znd_cgb__entry__2}

| Type | Description |
|-|-|
| SayAction | Action added to the NotifyAction object. Use the SayAction object to define the text and language to read. |
[Table 36. Returns]

{#NotifyAction-addGather_addSay__table_dp4_znd_cgb}  

    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();

    // present the user with a menu
    var gather = notifyAction.addGather();
    gather.setNumberOfDigits(1);    // the user can type 1 digit
    gather.setTimeout(20);          // time to enter answer, in seconds

    // add first menu item
    var gatherSay = gather.addSay();
    gatherSay.setText('Press 1 for english');
    gatherSay.setLanguage('en-US');

## NotifyAction - addGather.setFinishKey(String finishKey) {#ariaid-title20}

Defines the key that the caller inputs to denote the end of their input.
{#NotifyAction-addGather_setFinishKey_S__table_pk1_hmd_cgb__entry__3}

| Name | Type | Description |
|-|-|-|
| finishKey | String | Key that denotes the end of caller input. Valid values: * 0-9 * # (default) * \* {#NotifyAction-addGather_setFinishKey_S__ul_vv3_vhd_cgb} |
[Table 37. Parameters]

{#NotifyAction-addGather_setFinishKey_S__table_pk1_hmd_cgb} {#NotifyAction-addGather_setFinishKey_S__table_qk1_hmd_cgb__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 38. Returns]

{#NotifyAction-addGather_setFinishKey_S__table_qk1_hmd_cgb}  
This example shows how to add a gather action and define the key that denotes the end of
the caller input.

    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();

    var gather = notifyAction.addGather();
    gather.setNumberOfDigits(4);    // the user can type four digit
    gather.setFinishKey('#');       // # or *, useful for > 1 digit

## NotifyAction - addGather.setNumberOfDigits(Integer numberOfDigits) {#ariaid-title21}

Defines the number of digits to collect.
{#NotifyAction-addGather_setNumberOfDigits_I__table_f2w_3ld_cgb__entry__3}

| Name | Type | Description |
|-|-|-|
| numberOfDigits | Integer | Number of digits to collect. Zero is an invalid value. |
[Table 39. Parameters]

{#NotifyAction-addGather_setNumberOfDigits_I__table_f2w_3ld_cgb} {#NotifyAction-addGather_setNumberOfDigits_I__table_g2w_3ld_cgb__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 40. Returns]

{#NotifyAction-addGather_setNumberOfDigits_I__table_g2w_3ld_cgb}  
This example shows how to add a gather action and define the number of key strokes to
collect.

    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();

    // present the user with a menu
    var gather = notifyAction.addGather();
    gather.setNumberOfDigits(4);    // the user can type four digit
    gather.setFinishKey('#');       // # or *, useful for > 1 digits
    gather.setTimeout(20);          // time to enter answer, in seconds

## NotifyAction - addGather.setTimeout(Integer timeout) {#ariaid-title22}

Defines the amount of time after which gathering of input will timeout.
{#NotifyAction-addGather_setTimeout_I__table_ej2_1nd_cgb__entry__3}

| Name | Type | Description |
|-|-|-|
| timeout | Integer | Number of seconds to wait for caller input before timing out. Default: 10 |
[Table 41. Parameters]

{#NotifyAction-addGather_setTimeout_I__table_ej2_1nd_cgb} {#NotifyAction-addGather_setTimeout_I__table_fj2_1nd_cgb__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 42. Returns]

{#NotifyAction-addGather_setTimeout_I__table_fj2_1nd_cgb}  
This example shows how to add a gather action and define the input timeout value.

    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();

    // present the user with a menu
    var gather = notifyAction.addGather();
    gather.setNumberOfDigits(4);    // the user can type 1 digit
    gather.setFinishKey('#');       // # or *, useful for > 1 digits
    gather.setTimeout(20);          // time to enter answer, in seconds

## NotifyAction - addHangUp() {#ariaid-title23}

Ends an active phone call.
{#r_NotifyAction-addHangUp__table_tqt_lh4_wr__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 43. Parameters]

{#r_NotifyAction-addHangUp__table_tqt_lh4_wr} {#r_NotifyAction-addHangUp__table_uqt_lh4_wr__entry__2}

| Type | Description |
|-|-|
| HangUpAction | Action added to the NotifyAction object. |
[Table 44. Returns]

{#r_NotifyAction-addHangUp__table_uqt_lh4_wr}  

    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();

    // hang up
    notifyAction.addHangUp();

## NotifyAction - addQueue() {#ariaid-title24}

Queues the call, which puts the call on hold.
{#r_NotifyAction-addQueue__table_e5b_j24_wr__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 45. Parameters]

{#r_NotifyAction-addQueue__table_e5b_j24_wr} {#r_NotifyAction-addQueue__table_f5b_j24_wr__entry__2}

| Type | Description |
|-|-|
| QueueAction | Action added to the NotifyAction object. Use the QueueAction object to define the queue name, and queueing or dequeueing behavior. |
[Table 46. Returns]

{#r_NotifyAction-addQueue__table_f5b_j24_wr}  
This example shows how to add the call to the specified queue.

    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();

    // queue the call
    var queue = notifyAction.addQueue();
    queue.setName('my queue');

This example shows how to remove the call from the queue.

    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();

    // dequeue the call
    var queue = notifyAction.addQueue();
    queue.setDequeue(true);

## NotifyAction - addQueue.setDequeue(Boolean dequeue) {#ariaid-title25}

Removes the call from the current call queue (takes it off of "hold").
{#NotifyAction-addQueue_setDequeue_B__table_enw_wwd_cgb__entry__3}

| Name | Type | Description |
|-|-|-|
| dequeue | Boolean | Flag that indicates whether to remove the current call from the queue. * true: remove the call from the queue * false: call is put in the queue {#NotifyAction-addQueue_setDequeue_B__ul_lph_gxd_cgb} |
[Table 47. Parameters]

{#NotifyAction-addQueue_setDequeue_B__table_enw_wwd_cgb} {#NotifyAction-addQueue_setDequeue_B__table_fnw_wwd_cgb__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 48. Returns]

{#NotifyAction-addQueue_setDequeue_B__table_fnw_wwd_cgb}  
This example shows how to remove the call from the queue.

    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();

    // dequeue the call
    var queue = notifyAction.addQueue();
    queue.setDequeue(true);

## NotifyAction - addQueue.setName(String name) {#ariaid-title26}

Defines the name associated with a queue.
{#NotifyAction-addQueue_setName_S__table_fph_xvd_cgb__entry__3}

| Name | Type | Description |
|-|-|-|
| name | String | Name to associate with the queue. |
[Table 49. Parameters]

{#NotifyAction-addQueue_setName_S__table_fph_xvd_cgb} {#NotifyAction-addQueue_setName_S__table_gph_xvd_cgb__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 50. Returns]

{#NotifyAction-addQueue_setName_S__table_gph_xvd_cgb}  
This example shows how to define the name of a queue.

    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();

    // queue the call
    var queue = notifyAction.addQueue();
    queue.setName('my queue');

## NotifyAction - addPlay() {#ariaid-title27}

Plays an audio file on the call.
{#r_NotifyAction-addPlay__table_inp_1g4_wr__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 51. Parameters]

{#r_NotifyAction-addPlay__table_inp_1g4_wr} {#r_NotifyAction-addPlay__table_jnp_1g4_wr__entry__2}

| Type | Description |
|-|-|
| PlayAction | Action added to the NotifyAction object. Use the PlayAction object to define the audio file URL and number of times to loop the audio. |
[Table 52. Returns]

{#r_NotifyAction-addPlay__table_jnp_1g4_wr}  

    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();

    // add a play action
    var play = notifyAction.addPlay();
    play.setURL('http://www.moviesounds.com/2001/imsorry.wav');
    play.setLoop(1);

## NotifyAction - addPlay.setLoop(Integer loop) {#ariaid-title28}

Defines the number of times to play (loop through) the audio file.
{#NotifyAction-addPlay_setLoop_I__table_akq_1rd_cgb__entry__3}

| Name | Type | Description |
|-|-|-|
| loop | Integer | Number of times to play the audio file. |
[Table 53. Parameters]

{#NotifyAction-addPlay_setLoop_I__table_akq_1rd_cgb} {#NotifyAction-addPlay_setLoop_I__table_bkq_1rd_cgb__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 54. Returns]

{#NotifyAction-addPlay_setLoop_I__table_bkq_1rd_cgb}  

    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();

    // add a play action
    var play = notifyAction.addPlay();
    play.setURL('http://www.moviesounds.com/2001/imsorry.wav');
    play.setLoop(2);

## NotifyAction - addPlay.setURL(String url) {#ariaid-title29}

Defines the URL where to obtain the audio file to play.
{#NotifyAction-addPlay_setURL_S__table_t3n_pqd_cgb__entry__3}

| Name | Type | Description |
|-|-|-|
| url | String | URL of the audio file to play. |
[Table 55. Parameters]

{#NotifyAction-addPlay_setURL_S__table_t3n_pqd_cgb} {#NotifyAction-addPlay_setURL_S__table_u3n_pqd_cgb__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 56. Returns]

{#NotifyAction-addPlay_setURL_S__table_u3n_pqd_cgb}  

    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();

    // add a play action
    var play = notifyAction.addPlay();
    play.setURL('http://www.moviesounds.com/2001/imsorry.wav');
    play.setLoop(1);

## NotifyAction - addRecord() {#ariaid-title30}

Adds an action to record the call to the current NotifyAction object.
The recording automatically ends when the call is completed or when a specified terminate
is pressed (setFinishKey()). The recording is then placed in the
notify_record table for the associated call.
{#NotifyAction-addRecord__table_dyw_22x_zfb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 57. Parameters]

{#NotifyAction-addRecord__table_dyw_22x_zfb} {#NotifyAction-addRecord__table_eyw_22x_zfb__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 58. Returns]

{#NotifyAction-addRecord__table_eyw_22x_zfb}  
This example demonstrates how to record a call.

    // First we initialize NotifyAction
    var notifyAction = new SNC.NotifyAction();
     
    // Call addRecord() of NotifyAction -- This returns an object of type RecordAction
    var recordAction = notifyAction.addRecord();
     
    // Optional. Define the key that callers use to stop the recording
    recordAction.setFinishKey('#'); // Stop the call recording when caller presses the '#' key.

## NotifyAction - addRecord.setFinishKey(String finishKey) {#ariaid-title31}

Defines the key that terminates the recording.
{#NotifyAction-addRecord_setFinishKey_S__table_t1r_fhd_cgb__entry__3}

| Name | Type | Description |
|-|-|-|
| finishKey | String | Key that terminates the recording. Valid values: * 0-9 * # (default) * \* {#NotifyAction-addRecord_setFinishKey_S__ul_vv3_vhd_cgb} |
[Table 59. Parameters]

{#NotifyAction-addRecord_setFinishKey_S__table_t1r_fhd_cgb} {#NotifyAction-addRecord_setFinishKey_S__table_u1r_fhd_cgb__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 60. Returns]

{#NotifyAction-addRecord_setFinishKey_S__table_u1r_fhd_cgb}  
This example demonstrates how to record a call and set the call termination key.

    // First we initialize NotifyAction
    var notifyAction = new SNC.NotifyAction();
     
    // Then we call addRecord() of NotifyAction 
    var recordAction = notifyAction.addRecord();
     
    // Set the key that terminates the recording
    recordAction.setFinishKey('#'); // This means that we stop the call recording when user presses the '#' key.

## NotifyAction - addRecord.setMaxDuration(Integer seconds) {#ariaid-title32}

Defines the maximum length of the recording.
{#NotifyAction-addRecord_setMaxDuration_I__table_xv3_cjd_cgb__entry__3}

| Name | Type | Description |
|-|-|-|
| seconds | Integer | Maximum length of the recording in seconds. Default: 3600 |
[Table 61. Parameters]

{#NotifyAction-addRecord_setMaxDuration_I__table_xv3_cjd_cgb} {#NotifyAction-addRecord_setMaxDuration_I__table_yv3_cjd_cgb__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 62. Returns]

{#NotifyAction-addRecord_setMaxDuration_I__table_yv3_cjd_cgb}  
This example demonstrates how to record a call and set the call termination key.

    // First we initialize NotifyAction
    var notifyAction = new SNC.NotifyAction();
     
    // Then we call addRecord() of NotifyAction 
    var recordAction = notifyAction.addRecord();
     
    // Set the maximum length of the recording
    recordAction.setMaxDuration(4800); 

## NotifyAction - addRecord.setTimeout(Integer timeout) {#ariaid-title33}

Sets the number of seconds of silence, after which, the recording ends.
{#NotifyAction-addrecord_setTimeout_I__table_wnz_f3d_cgb__entry__3}

| Name | Type | Description |
|-|-|-|
| timeout | Integer | Number of seconds of silence on the call, after which the recording ends. Default: 10 |
[Table 63. Parameters]

{#NotifyAction-addrecord_setTimeout_I__table_wnz_f3d_cgb} {#NotifyAction-addrecord_setTimeout_I__table_xnz_f3d_cgb__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 64. Returns]

{#NotifyAction-addrecord_setTimeout_I__table_xnz_f3d_cgb}  
This example demonstrates how to record a call and set the recording timeout value.

    // First we initialize NotifyAction
    var notifyAction = new SNC.NotifyAction();
     
    // Then we call addRecord() of NotifyAction 
    var recordAction = notifyAction.addRecord();
     
    // Set the recoding timeout value
    recordAction.setTimeout(360); 

## NotifyAction - addReject() {#ariaid-title34}

Rejects an incoming call.
{#r_NotifyAction-addReject__table_z1j_rh4_wr__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 65. Parameters]

{#r_NotifyAction-addReject__table_z1j_rh4_wr} {#r_NotifyAction-addReject__table_abj_rh4_wr__entry__2}

| Type | Description |
|-|-|
| RejectAction | Action added to the NotifyAction object. Use the RejectAction object to define the reason for rejecting the call. |
[Table 66. Returns]

{#r_NotifyAction-addReject__table_abj_rh4_wr}  

    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();

    // reject the call
    var rejectAction = notifyAction.addReject();
    rejectAction.setReason('busy'); // 'busy' or 'rejected'

## NotifyActon - addReject.setReason(String reason) {#ariaid-title35}

Defines the reason why the call was rejected.
{#NotifyActon-addReject_setReason_S__table_fdf_bzd_cgb__entry__3}

| Name | Type | Description |
|-|-|-|
| reason | String | Reason why the call was rejected. Valid values: * busy * rejected {#NotifyActon-addReject_setReason_S__ul_bf1_wpy_cgb}All other values are ignored. |
[Table 67. Parameters]

{#NotifyActon-addReject_setReason_S__table_fdf_bzd_cgb} {#NotifyActon-addReject_setReason_S__table_gdf_bzd_cgb__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 68. Returns]

{#NotifyActon-addReject_setReason_S__table_gdf_bzd_cgb}  

    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();

    // reject the call
    var rejectAction = notifyAction.addReject();
    rejectAction.setReason('busy'); // 'busy' or 'rejected'

## NotifyAction - addSay() {#ariaid-title36}

Defines the text-to-speech to read on the call.
Multiple languages are supported with text-to-speech. Available languages depend on the
telephony provider.
{#r_NotifyAction-addSay__table_k1d_v24_wr__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 69. Parameters]

{#r_NotifyAction-addSay__table_k1d_v24_wr} {#r_NotifyAction-addSay__table_l1d_v24_wr__entry__2}

| Type | Description |
|-|-|
| SayAction | Action added to the NotifyAction object. Use the SayAction object to define the text and language to read. |
[Table 70. Returns]

{#r_NotifyAction-addSay__table_l1d_v24_wr}  
This example demonstrates reading text in several languages.

    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();

    // add a say action to say something in US English
    var usSay = notifyAction.addSay();
    usSay.setText('Welcome. I can speak english');
    usSay.setLanguage('en-US');

    // add a say action to say something in Dutch
    var nlSay = notifyAction.addSay();
    nlSay.setText('Ik spreek ook vloeiend nederlands');
    nlSay.setLanguage('nl-NL');

    // and german
    var deSay = notifyAction.addSay();
    deSay.setText('Und ich kan auch deutsch sprechen');
    deSay.setLanguage('de-DE');

## NotifyAction - addSay.setLanguage(String language) {#ariaid-title37}

Defines the language in which to speak the text.
Use this method in conjunction with the setText() method to define the
verbiage to speak.
{#NotifyAction-addSay_setLanguage_S__table_xsp_3bc_cgb__entry__3}

| Name | Type | Description |
|-|-|-|
| language | String | ISO 3166 language code that defines the language in which to speak the associated text. For example, "en-US" or "nl-NL". |
[Table 71. Parameters]

{#NotifyAction-addSay_setLanguage_S__table_xsp_3bc_cgb} {#NotifyAction-addSay_setLanguage_S__table_ysp_3bc_cgb__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 72. Returns]

{#NotifyAction-addSay_setLanguage_S__table_ysp_3bc_cgb}  
This example demonstrates reading text in several languages.

    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();

    // add a say action to say something in US English
    var usSay = notifyAction.addSay();
    usSay.setText('Welcome. I can speak english');
    usSay.setLanguage('en-US');

    // add a say action to say something in Dutch
    var nlSay = notifyAction.addSay();
    nlSay.setText('Ik spreek ook vloeiend nederlands');
    nlSay.setLanguage('nl-NL');

    // and german
    var deSay = notifyAction.addSay();
    deSay.setText('Und ich kan auch deutsch sprechen');
    deSay.setLanguage('de-DE');

## NotifyAction - addSay.setText(String text) {#ariaid-title38}

Defines the text to be read within the current call.
Use this method in conjunction with the setLanguage() method to define
the language in which to speak the provided text.
{#NotifyAction-addSay_setText_S__table_mz3_gvs_1gb__entry__3}

| Name | Type | Description |
|-|-|-|
| text | String | Text to read aloud within the current call. |
[Table 73. Parameters]

{#NotifyAction-addSay_setText_S__table_mz3_gvs_1gb} {#NotifyAction-addSay_setText_S__table_nz3_gvs_1gb__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 74. Returns]

{#NotifyAction-addSay_setText_S__table_nz3_gvs_1gb}  
This example demonstrates reading text in several languages.

    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();

    // add a say action to say something in US English
    var usSay = notifyAction.addSay();
    usSay.setText('Welcome. I can speak english');
    usSay.setLanguage('en-US');

    // add a say action to say something in Dutch
    var nlSay = notifyAction.addSay();
    nlSay.setText('Ik spreek ook vloeiend nederlands');
    nlSay.setLanguage('nl-NL');

    // and german
    var deSay = notifyAction.addSay();
    deSay.setText('Und ich kan auch deutsch sprechen');
    deSay.setLanguage('de-DE');

## NotifyAction - addSMS() {#ariaid-title39}

Sends an SMS message.
Note:  
When using this function with an active call, you do not need to call the setTo function on the returned SMSAction object. The SMS is automatically sent to the caller.
{#r_NotifyAction-addSMS__table_gw2_kg4_wr__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 75. Parameters]

{#r_NotifyAction-addSMS__table_gw2_kg4_wr} {#r_NotifyAction-addSMS__table_hw2_kg4_wr__entry__2}

| Type | Description |
|-|-|
| SMSAction | Action added to the NotifyAction object. Use the SMSAction object to define the message text and the phone number to which to send the message. |
[Table 76. Returns]

{#r_NotifyAction-addSMS__table_hw2_kg4_wr}  

    // Instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();

    // Define where to send the SMS to
    var number = new GlideElementPhoneNumber();
    number.setPhoneNumber('+31612345678', true);

    // Add an SMS action
    var sms = notifyAction.addSMS();
    sms.setMessage('Lorem ipsum dolor sit amet, consectetur adipiscing elit.');
    sms.setTo(number);

## NotifyAction - addSMS.setMessage(String message) {#ariaid-title40}

Defines the text of the SMS message to send.
{#NotifyAction-addSMS_setMessage_S__table_b2q_szd_cgb__entry__3}

| Name | Type | Description |
|-|-|-|
| message | String | Text of the SMS message to send. |
[Table 77. Parameters]

{#NotifyAction-addSMS_setMessage_S__table_b2q_szd_cgb} {#NotifyAction-addSMS_setMessage_S__table_c2q_szd_cgb__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 78. Returns]

{#NotifyAction-addSMS_setMessage_S__table_c2q_szd_cgb}  

    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();

    // define where to send the sms to
    var number = new GlideElementPhoneNumber();
    number.setPhoneNumber('+31612345678', true);

    // add a SMS action
    var sms = notifyAction.addSMS();
    sms.setMessage('Lorem ipsum dolor sit amet, consectetur adipiscing elit.');
    sms.setTo(number);

## NotifyAction - addSMS.setTo(String to) {#ariaid-title41}

Sets the phone number to which to sent the SMS message.
{#NotifyAction-addSMS_setTo_S__table_qtf_212_cgb__entry__3}

| Name | Type | Description |
|-|-|-|
| to | String | E.164-compliant phone number to which to send the SMS message. |
[Table 79. Parameters]

{#NotifyAction-addSMS_setTo_S__table_qtf_212_cgb} {#NotifyAction-addSMS_setTo_S__table_rtf_212_cgb__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 80. Returns]

{#NotifyAction-addSMS_setTo_S__table_rtf_212_cgb}  

    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();

    // define where to send the sms to
    var number = new GlideElementPhoneNumber();
    number.setPhoneNumber('+31612345678', true);

    // add a SMS action
    var sms = notifyAction.addSMS();
    sms.setMessage('Lorem ipsum dolor sit amet, consectetur adipiscing elit.');
    sms.setTo(number);

## NotifyAction - append(NotifyAction action) {#ariaid-title42}

Appends the specified NotifyAction object to the current client's NotifyAction
object.
There are two types of NotifyActions: terminal and non-terminal. Once you append a terminal action to a client's NotifyAction object, you cannot append any additional actions. Non-terminal actions include:

* PlayAction
* RecordAction
* SayAction
* SMSAction
{#NotifyAction-append_NA__ul_lfb_rqy_cgb}

All others NotifyActions are terminal. If you try to add another NotifyAction after a
terminal action, the call will fail.
{#NotifyAction-append_NA__table_rl3_3bx_zfb__entry__3}

| Name | Type | Description |
|-|-|-|
| action | NotifyAction | NotifyAction object to append to the NotifyAction object of the current caller. |
[Table 81. Parameters]

{#NotifyAction-append_NA__table_rl3_3bx_zfb} {#NotifyAction-append_NA__table_sl3_3bx_zfb__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 82. Returns]

{#NotifyAction-append_NA__table_sl3_3bx_zfb}

## NotifyAction - fromJson(String json) {#ariaid-title43}

Deserialize a NotifyAction object from a JSON string.
{#r_NotifyAction-fromJson_String__table_qc2_c34_wr__entry__3}

| Name | Type | Description |
|-|-|-|
| json | String | A JSON string representation of a NotifyAction object. |
[Table 83. Parameters]

{#r_NotifyAction-fromJson_String__table_qc2_c34_wr} {#r_NotifyAction-fromJson_String__table_rc2_c34_wr__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 84. Returns]

{#r_NotifyAction-fromJson_String__table_rc2_c34_wr}  
This example demonstrates deserializing a NotifyAction object.

    var json = ".... some json obtained from toJson ....";

    // instantiate notify action
    var notifyAction = new SNC.NotifyAction();

    // deserialize and reconstruct the notify action instance
    notifyAction.fromJson(json);

This example demonstrates both serializing and deserializing a NotifyAction object.

    // instantiate notify action
    var notifyAction = new SNC.NotifyAction();

    // add a queue
    var queue = notifyAction.addQueue();
    queue.setName('myQueueName');
    queue.setDequeue(false);

    // serialize to json
    var json = notifyAction.toJson();
    gs.log('serialization result: ' + json);

    // instantiate a new notify action
    var newAction = new SNC.NotifyAction();

    // deserialize the json generated above
    newAction.fromJson(json);

    // serialize the new object and log the result
    newJson = newAction.toJson();
    gs.log('new serialization result: ' + newJson);
    gs.log('the same: ' + (json == newJson));

Output: \*\*\* Script: serialization result:
{"fClassName":"NotifyAction","fActions":\[{"fClassName":"QueueAction","fDequeue":true,"fQueueName":"myQueueName"}\]}
\*\*\* Script: new serialization result:
{"fClassName":"NotifyAction","fActions":\[{"fClassName":"QueueAction","fDequeue":true,"fQueueName":"myQueueName"}\]}
\*\*\* Script: the same: true

## NotifyAction - setCallRecord(GlideRecord callRecord) {#ariaid-title44}

Defines the Notify call record in which to add subsequent actions.
{#NotifyAction-setCallRecord_GR__table_uwv_vvv_zfb__entry__3}

| Name | Type | Description |
|-|-|-|
| callRecord | GlideRecord | GlideRecord containing the record of the caller (within the notify_call table) for which to add actions. This caller stays in affect until this method is called again with a different caller. |
[Table 85. Parameters]

{#NotifyAction-setCallRecord_GR__table_uwv_vvv_zfb} {#NotifyAction-setCallRecord_GR__table_vwv_vvv_zfb__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 86. Returns]

{#NotifyAction-setCallRecord_GR__table_vwv_vvv_zfb}  
This example shows how to set the caller to which you want to add actions.

    public NotifyAction runIncomingCallWorkflow(NotifyPhoneNumber notifyPhoneNumber, GlideRecord callRecord) throws NoWorkflowConfiguredException, NoSuchNotifyGroupRecordException {
       NotifyAction notifyAction = runWorkflow(notifyPhoneNumber, COL_INCOMING_CALL_WF, callRecord);
       notifyAction.setCallRecord(callRecord);
       return notifyAction;
    }

## NotifyAction - toJson() {#ariaid-title45}

Serialize the NotifyAction object to a JSON string.
{#r_NotifyAction-toJson__table_ygy_xh4_wr__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 87. Parameters]

{#r_NotifyAction-toJson__table_ygy_xh4_wr} {#r_NotifyAction-toJson__table_zgy_xh4_wr__entry__2}

| Type | Description |
|-|-|
| String | JSON representation of this NotifyAction object. |
[Table 88. Returns]

{#r_NotifyAction-toJson__table_zgy_xh4_wr}  
This example demonstrates serializing a NotifyAction object.

    // instantiate notify action
    var notifyAction = new SNC.NotifyAction();

    // add one or more notify actions
    // ...

    // and serialize to json
    var json = notifyAction.toJson();

This example demonstrates both serializing and deserializing a NotifyAction object.

    // instantiate notify action
    var notifyAction = new SNC.NotifyAction();

    // add a queue
    var queue = notifyAction.addQueue();
    queue.setName('myQueueName');
    queue.setDequeue(false);

    // serialize to json
    var json = notifyAction.toJson();
    gs.log('serialization result: ' + json);

    // instantiate a new notify action
    var newAction = new SNC.NotifyAction();

    // deserialize the json generated above
    newAction.fromJson(json);

    // serialize the new object and log the result
    newJson = newAction.toJson();
    gs.log('new serialization result: ' + newJson);
    gs.log('the same: ' + (json == newJson));

Output: \*\*\* Script: serialization result:
{"fClassName":"NotifyAction","fActions":\[{"fClassName":"QueueAction","fDequeue":true,"fQueueName":"myQueueName"}\]}
\*\*\* Script: new serialization result:
{"fClassName":"NotifyAction","fActions":\[{"fClassName":"QueueAction","fDequeue":true,"fQueueName":"myQueueName"}\]}
\*\*\* Script: the same: true

