Develop a Basic Script

This help page is for CXone Studio. This information is also available for Desktop Studio.

Required permissionsScripts Create/Edit

The tutorials on this page lead you through the process of creating a simple inbound phone script. This script creates a basic IVRClosed Automated phone menu that allows callers to interact through voice commands, key inputs, or both, to obtain information, route an inbound voice call, or both. menu. The script does the following things: 

  • Verify that at least one agent is available to handle the call.
  • Present a menu to the caller.
  • Request an agent to handle the caller after their menu selection is made.
  • Play hold music until an agent answers the call.
  1. In CXone, click the app selector and select Omnichannel RoutingStudio Three arrows joined at the base. One points straight up, one up and to the right, and one up and to the left. .
  2. Click New Script and select Phone An old-style phone receiver. .
  3. Click Actions A squre, triangle, and circle with the edges overlapping., then use the Search actions field to search for the following actions: Begin, Countagents, If, Play, Hangup, Menu, Reqagent, Music, and Wait. As you find them, drag and drop each one on the canvas workspace.
  4. Arrange the actions to match the following image. If you cannot view the image, the sequence is provided in the drop-down below the image.

  5. Connect the actions: 
    1. Hover the cursor over the action icon, then click and hold the connection point on the side of the action closest to the next action.
    2. Drag the cursor to the connection point on the action to the right and release.
    3. Click Condition A small circle with two lines attached. One line has a check mark next to it and the other has an X. and then select Default for all actions except If.
    4. Add the connectors for If. Select the False condition when connecting to Play and True when connecting to Menu.

      When connecting with a Default condition, you can click the connector point after the icon changes to the filled-in blue circle. This automatically adds the connector with the Default condition to the nearest connector point on the next action.

  6. Configure the If action so that it determines whether agents are logged in to handle the call: 
    1. Click the If to view its properties on the right side of the page.

    2. Click in the Expression property field and enter AVAIL>0.
    3. Click in the Add caption property field and enter Check if agents available. This changes the label that appears on the script canvas.

      Now If will send the caller to the menu if there are agents available, or to an automated message if there aren't any agents.

  7. Configure Play to play an automated message for times when there aren't any agents available: 
    1. Click Play to view its properties on the right side of the page.

    2. Click in the Add caption property field and enter When no agents available. This changes the label that appears on the script canvas.

    3. Click Open Editor in the action properties.

    4. Click Text to Speech.
    5. Under Play Order Sequence, select the text-to-speech segment and click Edit A pencil..

      Sequence is the name for the prompt definitions you create in the sequence editor. A sequence is made up of one or more segment. Each segment defines a portion of the complete prompt sequence. The different segment options in the sequence editor allow you to have the text-to-speech service read different types of text, such as numbers, dates, or words spelled out letter by letter.

    6. In the segment field, replace the default text, The little brown fox, with the message you want callers to hear when no agents are available. For example, you could use this message: We're currently experiencing technical difficulties. Please call back later. 

    7. Copy the message from segment field and paste it into the Phrase field. You may need to scroll down in the sequence editor window to find this field. Phrase is for your information only and makes it easy to know what the prompt sequence says.
    8. Click Apply Changes.

  8. Configure the audio prompts for the Menu action to play: 
    1. Click Menu to view its properties on the right side of the page.

    2. Click in the Add caption property field and enter When agents are available. This changes the label that appears on the script canvas.

    3. Click Open Editor to open the sequence editor window.
    4. Click Text to Speech.
    5. Under Play Order Sequence, select the text-to-speech segment and click Edit A pencil..
    6. In the segment field, replace the default text, The little brown fox, with the a message that tells callers they'll be connected with an agent soon. Because this script currently only has one branch from the Menu action, all contacts would be automatically connected to the same queue of agents. For example, you could use this message: Please hold for the next available agent.
  9. Configure the Music action to play hold music while contacts wait for an agent: 
    1. Click Music to view its properties on the right side of the page.

    2. In the MusicFile field, select the music file you want to use as hold music from the drop-down list.

  10. Configure the Wait action to a brief pause between repeats of the music the Music action plays.
    1. Click Wait to view its properties on the right side of the page.
    2. Change Seconds to .5.
    3. To finish the configuration of Wait, you need to connect it back to Music so it creates a loop that can repeat until an agent answers the call. Hover the cursor over Wait, then click and hold the connection point on the side of the action closest to Music. Drag the connector to Music and drop it on a connection point, then select the Default condition.

  11. Click Create at the top of the script window to save the script.
  12. Enter a Name and choose a Location for the script, then click Create. You script should look similar to the following example:

  13. You can test your script by simulating an interaction in Studio. Currently, you must simulate interactions in the Desktop Studio application. Save it in CXone Studio, then open it in Desktop Studio. This will not harm the script.

Add More Menu Choices

You can expand this script to offer more than one option in the IVR menu created with Menu.

  1. In your script, select the connector between Menu and Reqagent. If you click the connector line and cannot select it, try dragging one of the actions away from the other. You cannot select a connector line if the actions are too close together.

  2. Click Delete A trash can. on the pop-up menu.

  3. Click in the white space near the upper left corner of the Reqagent action and drag down and to the right so that the dotted lines surround Reqagent, Music, and Wait. Release the click. This selects the three actions.
  4. Press CTRL + C on your keyboard.
  5. Click on the script canvas and press CTRL + V on your keyboard. Duplicates of the selected actions appear over the selected actions.
  6. Click on the pasted copies and drag them into the white space under the original set of actions.
  7. Repeat steps 2-5 to create a third set of actions. The following image shows and example of what your script may look like. In this example, the actions were moved to stack vertically before copying them. This makes better use of the canvas space for example images in the online help and isn't required.

  8. Create custom branch conditions to connect Menu to each Reqagent action. The conditions you create match the numbers (DTMFClosed Signaling tones that are generated when a user presses or taps a key on their telephone keypad. tones) the contact must enter on their phone to select each option. Follow these steps: 
    1. Drag a connector from Menu to the first Reqagent.

    2. Click Condition A small circle with two lines attached. One line has a check mark next to it and the other has an X. and then select Add Custom Condition.
    3. In the Enter condition name field, enter 1 and press Enter on your keyboard. The connector automatically appears on the canvas with the custom condition.

    4. Repeat these steps to add conditions 2 and 3 to connect Menu to the remaining two Reqagent actions. The connectors don't need to come from the same connection point on Menu. Your script should look similar to the following example.

  9. Create a new audio prompts for the Menu action to play: 
    1. Click Menu to view its properties on the right side of the page.

    2. Click Open Editor to open the sequenceClosed A segment of an audio prompt played for the contact. editor window.
    3. Under Play Order Sequence, select the text-to-speech segment you added previously and click Edit A pencil..
    4. In the segment field, replace the existing text with a new a message that lets callers know what the menu options are. For example, Thanks for calling Classics, Incorporated. For Sales, press 1. For Support, press 2. For Billing, press 3.
  10. For each set of Reqagent, Music, and Wait actions, do the following steps: 
    1. Select Reqagent and change the Add caption property to the destination you named in your new Menu prompt. For example, Sales, Support, Billing, and so on.
    2. Click Reqagent to view its properties.
    3. Select an inbound phone ACD skillClosed Used to automate delivery of interactions based on agent skills, abilities, and knowledge from the Skill drop-down. The script will request agents with this ACD skill to handle the contacts who choose this option.

      In a script intended for production, you must choose an ACD skill that matches the destination of each menu option. For example, on the Support branch of the script, the skill you choose must to be assigned to agents who handle Support calls.

    4. Right-click Music and change the MusicFile selection to a different file.
  11. Save your script and test it with another simulated interaction. At this point your script should look similar to this example:

Learn More

You can learn more about the script you just created on the following online help pages: 

  • Online help for each action in this script is available: 
  • You can use Play and Menu to create many kinds of prompts to play for contacts. This tutorial shows how to create a simple text-to-speech prompt. The Prompts help page provides more information about the options available.
  • The If action creates a decision-making statement in your script.
  • You can learn more basic script skills on the Work with Scripts help page.
  • You can learn more about using actions in the Action Basics help page.