LOOP

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

Repeats the action or actions connected to the Repeat branch the specified number of times. After the specified number of iterations, the Finish branch is triggered.

For example, you could add this action to an IVRClosed Interactive Voice Response. Automated phone menu contacts use via voice or key inputs to obtain information, route an inbound voice call, or both. menu to have contacts try again if they press an invalid number. Set the Repeat property is set to 3 to give the contact three attempts. During an interaction where the contact presses an invalid number, the actions connected to the Repeat branch condition execute three times. The next time the loop executes, the script takes the Finish branch and sends the contact to an operator.

Supported Script Types

A square with a line branching from it that goes to three other squares.

Generic

Email Chat Phone Voicemail Work Item SMS Digital

Input Properties

These properties define data that the action uses when executing.

Property

Description

Add Caption

Enter a short phrase that uniquely identifies this action in the script. The caption appears on the script canvas under the action icon.

Repeat The number of times the loop will repeat before the OnFinished branch is taken.
Counter Name Name of a variable to receive the current value of FromValue plus Step.

Result Branch Conditions

Result branch conditions allow you to create branches in your script to handle different outcomes when an action executes.

Condition

Description

Finished

Path taken when the Repeat count exceeds the specified number.

Repeat

Path taken while the current Repeat count is less than or equal to the specified number.

Script Example

This is an example to show how this action can be used in scripts. It is not intended to be a complete script. Additional scripting may be required.

After the script is triggered, Voiceparams sets the text-to-speech voice and Hours sets the hours of operation (using the Hours of Operation profile). When the script reaches the Menu action, a message is played, asking the caller to press 1 to request an agent. If 1 is not pressed in 5 seconds (set in the Menu Timeout property), then the Loop will be triggered, at which time a message will play, telling the contact to try again. The loop will occur three times, and on the fourth time, the loop will follow the Finished branch instead of the Repeat branch. On the Finished branch, a different message will play, telling the contact to call back later and then hangs up the call.

Would you like to download this script?

In a simple event, when a call is placed on hold a loop will occur in which music plays, followed by a message, followed by music and another message and so on until the call is taken off hold.

Would you like to download this script?