Loop

執行重複分支條件指定的次數。

按照 Repeat 屬性所說明的次數執行「重複」分支。例如,如果 Repeat5,則將執行符合 Repeat 分支條件的動作的 5 次重複。在 Repeat 分支中設定的反覆運算完成後,下一次執行 Loop 時,將觸發 Finish 分支。

例如,在 IVRClosed 自動電話選單,允許呼叫者透過語音命令或按鍵輸入或二者進行互動,以獲取資訊、路由至呼入語音通話或二者兼有。 選單中,您可以新增一個 Loop,讓聯絡人在按下無效號碼時重試。您可以將迴圈設定為在將聯絡人傳送給接線員之前讓其嘗試三次。

Supported Script Types

The icon for a Generic script type - a rectangle with < and > symbols inside it.

The icon for the Email script type - a large @ symbol in a diamond.

The icon for the Chat script type - a chat bubble with an ellipsis inside (...), in a diamond shape.

The icon for the Phone script type - an old-style phone handset with curved lines indicating sound coming out of it.

The icon for the Voicemail script type - a symbol that looks like a cassette tape - two circles sitting on a horizontal line.

The icon for the Work Item script type-a piece of paper with one corner folded down and a bullet list on it.

The icon for the SMS script type - a smart phone with a chat bubble coming out of it.

The icon for the Digital script type - a computer monitor with a smartphone next to it.

一般

電郵 聊天 電話 語音郵件 工作項目 SMS 數位

Input Properties

這些屬性定義了動作執行時使用的資料。

屬性

描述

Repeat 在採取 OnFinished 分支之前,迴圈的重複次數。
CounterName 接收FromValueStep目前值的變數名稱。

Result Branch Conditions

結果分支條件允許您在指令碼中建立分支,以處理執行動作時的不同結果。

條件

描述

OnFinished

重複次數超過指定次數時的路徑。

OnRepeat

當前重複計數小於或等於指定數量時採用的路徑。

Script Example

此範例不是一個完整的指令碼。使用此動作時需要額外的指令碼編寫工作。

fter 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?