CASE

此説明頁面適用於 Studio。 此資訊亦適用於 Desktop Studio。

相依性

  • 對於每個可能的變數值,您都必須建立一個自訂分支條件。
  • 請務必連接Case 動作的Default分支。假如變數屬性中的變數有時可能持有不同或非預期的值,這一點尤其重要。連接Default分支可讓程式碼有方法處理非預期的值。

支援的程式碼類型

一個正方形,其上有一條通往其他三個正方形的分支線。

Icon of gray-green envelope

深綠色語音氣泡圖示

Icon of purple telephone handset

鏽色留言符號圖示,由兩個以線條相連的圓形組成

Icon of pink document with lines of text

Icon of green mobile phone with a speech bubble on its screen

Icon of purple computer monitor with a mobile device overlapping its lower right corner

通用

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

輸入屬性

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

屬性

描述

新增標題

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

變數 您想從CASE擷取值的變數名稱。

結果分支條件

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

條件

描述

預設 Path taken unless the script meets a condition that requires it to take one of the other branches. It is also taken if the action's other branches are not defined.
新增自訂條件 Paths created and taken when connecting to secondary actions using Variable Branch Conditions. Click the ellipsis to open the ConnectView Collection Editor to customize these branches. 建立自訂條件時,條件名稱必須是觸發程式碼關注此分支的變數值。

程式碼範例

下面是一個範例,說明如何在指令碼中使用此動作。 這不是一個完整的指令碼。 可能需要額外的指令碼。

在此範例中,Case 連接至三個不同的 Runscript 動作。 如果來電的 DNISClosed 在撥入或撥出語音通話中所撥打的號碼。 為 8881234567,則 Sales(銷售)Runscript 動作將執行指定的子指令碼。 如果 DNIS 為 8771234567,則 Collections(收款)Runscript 動作將執行另一個指令碼。 最後,如果電話並非透過該兩個DNIS數字之一接入,則客戶服務Runscript動作會觸發子程式。

使用 Case 動作的範例腳本

下載此程式碼。