Develop a Basic Script

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: 

  • Verifies that at least one agent is available to handle the call.
  • Presents a menu to the caller.
  • Requests an agent to handle the caller after their menu selection is made.
  • Plays hold music until an agent answers the call.
  1. Open Studio and log in.
  2. Click File > New and select Phone.
  3. Click OK.
  4. On the Tools tab, use the Filter 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.
  5. 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.

  6. Connect the actions: 
    1. Hover the cursor over the bottom right corner of the action until you see an arrow.
    2. Click and hold the arrow and drag it to the action to the right and release.
    3. Choose the Default branch for all actions except If. Begin doesn't prompt you to choose a branch condition because it only has a Default branch.
    4. Add the connectors for If. Select the False branch when connecting to Play and the True branch when connecting to Menu.
  7. Configure the If action to take different actions based on the number passed to it by Countagents. This number indicates how many agents are logged in to handle the call.
    1. Right-click the If to open the Properties window. You can also select If and click the Properties tab.

    2. Click in the Expression property field and enter AVAIL>0.
    3. Click in the Caption property field and enter Check if agents available. This changes the label that appears on the script canvas.
    4. Click the white space of the canvas workspace to close the Properties window.

      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.

  8. Configure Play to play an automated message for times when there aren't any agents logged in and available: 
    1. Right-click on Play to open the Properties window.

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

    3. Click on the script canvas to close the Properties window.

    4. Double-click the Play action to open the Sequence Editor window.
    5. Click Synthesize Text.
    6. In the Sequence Value field, enter 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. Another option is to use this sequence of actions as your after-hours message. In that case, you could use this message: Our office is currently closed. Please call back tomorrow morning after 8:00 a.m.
    7. Copy the message from Sequence Value and paste it into the Phrase field. This is for your information only and makes it easy to know what the prompt sequence says.
    8. Click OK.

  9. Configure the audio prompts for the Menu action to play when there are agents logged in and available to handle contacts: 
    1. Right-click on Menu to open the Properties window.

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

    3. Click on the script canvas to close the Properties window.

    4. Double-click Menu to open the Sequence Editor window.
    5. Click Synthesize Text.
    6. In the Sequence Value field, enter a message that tells callers they'll be connected with an agent. Because this script 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.
  10. Configure the Music action to play on-hold music while contacts wait for an agent: 
    1. Right-click on Menu to open the Properties window.

    2. In the MusicFile property field. click the drop-down arrow and select the music file you want to use as hold music.

    3. Click in the Caption property field and enter the name of the music file you selected. This changes the label that appears on the script canvas. You can click on the MusicFile property label and press CTRL + C, then click on the Caption label and press CTRL + V to paste in the name of the file.

    4. Click on the script canvas to close the Properties window.

  11. Configure the Wait action to a brief pause between repeats of the music the Music action plays.
    1. Right-click on Wait and change Seconds to .5.
    2. Click on the script canvas to close the Properties window.
    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 the bottom right corner of the Waiticon until you see an arrow, then click and hold the arrow. Drag the connector to Music and release.
    4. You can bend one of the connectors between Wait and Music so they can both be seen. Press CTRL + SHIFT and hover the cursor over the connectors between the two actions. When the line turns blue, right-click. This creates an anchor. You can click and drag the anchor to bend the connector. You can learn more about this step on the Work with Scripts help page.
  12. Save and name the script (File > Save).
  13. You can test your script by simulating an interaction in Studio.

Add More Menu Choices

You can expand this script to offer more than one menu option. Before you complete this part of the tutorial, you need to make sure that your business unitClosed High-level organizational grouping used to manage technical support, billing, and global settings for your CXone environment has three ACD skillsClosed Used to automate delivery of interactions based on agent skills, abilities, and knowledge you can use in this script. In the first part of the tutorial, no ACD skill was assigned to the Reqagent action. The script would use the default ACD skill for the business unitClosed High-level organizational grouping used to manage technical support, billing, and global settings for your CXone environment, which is the default configuration for the Skill property of Reqagent.

If you need to, you can create three example skills to use in the tutorial. Be sure to follow any policies your organization has about creating test entities in CXone.

  1. In your script, select the connector between Menu and Reqagent and press Delete on your keyboard.
  2. 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 mouse button. This selects the three actions.

  3. Press CTRL + C on your keyboard.
  4. Click on the script canvas and press CTRL + V on your keyboard. Duplicates of the selected actions appear over the selected actions.
  5. Click on the pasted copies and drag them into the white space under the original set of actions.
  6. Repeat steps 2–5 to create a third set of actions. When you're finished your script should look like this:

  7. Create custom branch conditions to connect Menu to each Reqagent action: 
    1. Drag a connector from Menu to the first Reqagent.

    2. On the PickBranch window, click the plus sign + and enter 1 in the field that appears.
    3. Select the condition you just added and click OK.
    4. Repeat these steps to add conditions 2 and 3 and connect them to the remaining two Reqagent actions. Your script should look like this:

  8. Create a new audio prompt for the Menu action to play: 
    1. Double-click Menu to open the Sequence Editor window.
    2. Click Synthesize Text.
    3. In the Sequence Value field, enter a message that lets callers know what their options are. For example, Thanks for calling Classics, Incorporated. For Sales, press 1. For Support, press 2. For Billing, press 3.
  9. For each set of Reqagent, Music, and Wait actions, do the following steps: 
    1. Right-click on Reqagent and change the Caption property to the destination you named in your new Menu prompt. For example, Sales, Support, Billing, and so on.
    2. In the Reqagent properties, click the drop-down arrow in the Skill property field and select an inbound phone ACD skillClosed Used to automate delivery of interactions based on agent skills, abilities, and knowledge to assign to this action. The script will request agents with this ACD skill to handle the contacts who choose this option. In a script intended for production, you would need to choose a skill that matches the destination of the menu option. For example, on the Support branch of the script, the skill would need to be assigned to agents who handle Support calls.
    3. Right-click on Music and change the MusicFile selection to a different file.
    4. Update the Music action's caption to match the new music file.
  10. Save your script and test it with another simulated interaction.

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 about this kind of statement in the Technical Guide section of the Studio online help.
  • You can learn more basic script skills in the Script Basics help page.
  • You can learn more about using actions in the Action Basics help page.