Loop
此説明頁面適用於 Desktop Studio。 此資訊亦適用於 Studio。
|
|
將連接至 重複 分支的一個或多個動作重複執行指定的次數。 在達到指定的疊代次數後,將會觸發Finish分支。 例如,您可以將此動作加入IVR |
支援的程式碼類型
|
|
|
|
|
|
```
|
|
|
|
通用 |
電郵 | 聊天 | 電話 | 語音郵件 | 工作項目 | SMS |
|
輸入屬性
這些屬性定義了動作執行時使用的資料。
|
屬性 |
描述 |
|---|---|
| 重複 | The number of times the loop will repeat before the OnFinished branch is taken. |
| 計數器名稱 | Name of a variable to receive the current value of FromValue plus Step. |
結果分支條件
結果分支條件允許您在指令碼中建立分支,以處理執行動作時的不同結果。
|
條件 |
```
描述 ``` |
|---|---|
|
OnFinished |
Path taken when the Repeat count exceeds the specified number. |
|
OnRepeat |
Path taken while the current Repeat count is less than or equal to the specified number. |
程式碼範例
下面是一個範例,說明如何在指令碼中使用此動作。 這不是一個完整的指令碼。 可能需要額外的指令碼。
在觸發程式碼後,
是否要下載此指令碼?
在一個簡單的事件中,當電話被保留時,將會發生一個循環,先播放音樂,然後播放訊息,接著再播放音樂和另一則訊息,如此類推,直到電話被關閉保留為止。
是否要下載此指令碼?
貼士與技巧
如果您的迴圈出現異常行為,或發生非預期的行為,請稍後在程式碼開頭將CounterName變數重設為0。