Architect’s task editor helps you group the related steps of a more comprehensive process. In many cases, you’ll use expressions to build these complex call flow calculations. Architect also offers a concentrated, comprehensive list of elements to assist you with expression building. We’ll explore some of these areas in this lesson.

Here, we want to build a task sequence that determines the following information about the current call:

  • Time of day (morning, afternoon, or evening)
  • Caller’s name
  • Current day of the week

Next, we want the system to play the information back to the caller in the form of an audio sequence. When the caller enters the flow, he or she hears “Good [morning, afternoon, or evening], [name of caller].  Today is [day of the week].” Additionally, Friday callers will hear about Saturday’s new operating hours with this message: “A friendly reminder that our hours of operation for Saturday have changed.  If you need to reach us tomorrow, we will be available from nine until noon.”  

Note: In this lesson, you will create collections that incorporate flow and call variables, define expressions using the Update Data action, build audio sequences, and access Architect’s Expression Help.

Objectives

Create a task that collects information for and about the current call, and plays that information back to the caller

Estimated time to complete: 40 minutes

Additional resources

Click the image to enlarge.

Task Editor Expression Help

Tasks

  1. From the Architect Home page, click the Inbound Call Flows tab.
  2. Add a new inbound flow, including a unique name and, optionally, a short sentence or phrase to further describe this call flow. In our example, we name the inbound call flow Weekday.
  3. Create a new Reusable Task and set it as the starting task.
  4. Name the task Day of the week.
  5. For the Initial Greeting, optionally record a prompt or add TTS to greet the caller.
  6. Click Edit Task.

Begin building the starting task by adding audio to the task, then create a decision action that directs the flow to pull the current day of the week from a string collection.

  1. Drag a Play Audio action into the task editor and title it Initial audio.
  2. Record a prompt or add TTS to greet the caller:

Thank you for calling.

  1. Drag a Decision task below the Play Audio task, and then drag an Update Data action below the Decision action’s No path.
  2. Name the Update Data action Days of the Week.
  3. Click the arrow at the end of the Add update statement drop-down list and do the following:
    1. Click Create Collection.
    2. Select String Collection.
  4. In the Variable Name box, type Flow.DaysOfTheWeek.
  5. In the Value To Assign box, click + String.
  6. In the Item box type Sunday
  7. Repeat step 7 to add the remaining days of the week.

Your collection should look like this:

String collection

Here, continue the sequence by adding an Update Data action to retrieve the current day from the call.

  1. Drag an Update Data action below the Days of the Week Update Data action.
  2. Name the action Today.
  3. Click the arrow at the end of the Add update statement drop-down list, select String, and do the following:
    1. In the Variable Name box, type Flow.Today.
    2. In the Value To Assign box, switch to expression mode and open the large expression editor. The Edit ‘Value To Assign 1’ expression dialog box opens.
    3. Begin typing Get. A list of available functions appears in a drop-down list.
    4. Assume you are not sure exactly which expression to use here and in the drop-down list click the ? next to GetAt. The Expression Help opens, and we see that this particular function retrieves an item at a specific location in a collection. This looks like the function we want to use. You can optionally learn more about it by expanding the Implementation section for more details and examples of use. 
    5. When finished, click X in the upper right corner to close the Expression Help.
  4. Back in the ‘Edit Value To Assign 1’ expression dialog box, finish typing GetAt and press Enter. Notice that the cursor is positioned inside the set of parentheses.
    1. Ensure the cursor is positioned inside the GetAt parentheses, begin typing Flow., and select Flow.DaysOfTheWeek from the list that appears.
    2. With the cursor positioned just before the close parenthesis, add a comma and begin typing DayOf. Notice the list of options available in the drop-down list.
    3. To confirm that you choose the correct function, click the ? next to DayOfWeek. The Expression Help opens, and we see that this particular function obtains the day of the week from the supplied value. 
    4. In the Expression Help, expand the Integer section for more details and examples. This looks like the function we want to use.
    5. When finished, click X in the upper right corner to close the Expression Help.
  5. Back in the ‘Edit Value To Assign 1’ expression dialog box, finish typing the DayOfWeek() function.
  6. With the cursor positioned just before the two close parentheses at the end of the expression, begin typing Flow. and select Flow.StartDateTimeUtc from the list.
  7. Click Close.

Your final expression should look like this:

GetAt(Flow.DaysOfTheWeek, DayOfWeek(Flow.StartDateTimeUtc))

Next, continue the sequence by adding an Update Data action that directs the system to collect the time of day:

  1. Drag an Update Data action below the Today Update Data action.
  2. Name the action Time of Day.
  3. Click the arrow at the end of the Add update statement drop-down list, select String, and do the following:
    1. In the Variable Name box, type Flow.TimeOfDay.
    2. the Value To Assign box, switch to expression mode and open the large expression editor. The Edit Value To Assign 1′ expression dialog box opens.
    3. Begin typing IfA list of available functions appears in a drop-down list.
    4. Optionally click the ? next to the If() expression in the list to open the Expression Help. Here, you can explore the function details and expand the implementations and, when finished, click X to close the Expression Help.
  4. Back in the ‘Edit Value To Assign 1’ expression dialog box, finish typing the If() function.
    1. With the cursor positioned inside the If parentheses, begin typing Hour and select Hour() from the list that appears.
    2. With the cursor positioned just before the two close parentheses, begin typing Flow. Notice the list of options available in the drop-down list.
    3. Select Flow.StartDateTimeUTC.
  5. Continue the expression so that if the hour is less than 12, the system will read as morning hours. If the hour is less than 17, afternoon or evening.
  6. With the cursor positioned just inside the last close parenthesis, type <12, "Morning",.
  7. With the cursor positioned between the last comma and the last close parenthesis, type if(Hour(Flow.StartDateTimeUtc).
  8. With the cursor positioned just inside the last two close parentheses, type  <17,"Afternoon","Evening".
  9. Click Close.

Your final expression should look like this:

If(Hour(Flow.StartDateTimeUtc) < 12, "Morning", if(Hour(Flow.StartDateTimeUtc) < 17,"Afternoon", "Evening"))

Create the audio sequence that informs the caller of the date and time, depending on collected data.

  1. Drag a Play Audio action below the Time of Day Update Data action and name it Greeting.
  2. In the Audio box, click the audio sequence editor button and do the following:
    1. In the Text To Speech box, type Good.
    2. Click the Add Data button and in the Data box type Flow.TimeOfDay.
    3. Click the arrow at the end of the Select Options drop-down list and select Text to speech
    4. Click the Add Data button and in the Data box type Call.RemoteName.
    5. Click the arrow at the end of the Select Options drop-down list and select Text to speech.
    6. Click the Add TTS button and in the Text to Speech box type Today is.
    7. Click the Add Data button and in the Data box type Flow.Today.
    8. Click the arrow at the end of the Select Options drop-down list and select Text to speech.
    9. Click Close.

Set up the path to take when the system detects if the next day is Saturday and if so, play Saturday hours to the caller. Then complete the task.

  1. Drag a Decision action into the task editor below the Greeting Play Audio action and title it Is tomorrow Saturday?.
  2. In the Expression box, switch to expression mode, remove the True text, and type Flow.Today=="Friday".
  3. Drag a Play Audio action below the Is tomorrow Saturday? Decision action’s Yes path and title it Play Saturday Hours.
  4. In the Audio box, record a prompt or add TTS to inform the caller of Saturday hours:

A friendly reminder that our hours of operation for Saturday have changed.  If you need to reach us tomorrow, we will be available from nine until noon. 

  1. Drag a Jump to Menu action into the last space at the bottom of the task editor.
  2. Select Main Menu, then validate and save or publish the flow.

Practice

Now it’s your turn. Try creating a similar experience in your own environment. For example, you might set up a greeting specific to play to callers during a particular month, such as “Seasons Greetings” in December. Or you might inform callers of seasonal hours, such as summer hours in July. For additional assistance, refer to the corresponding task instructions and the supporting video.