Readfile

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

將檔案中的資料讀取至區域變數中。此操作嘗試讀取FileName屬性中命名的任何檔。 不是所有的檔案類型都可讀。 例如,圖像和音樂檔案可能無法透過此動作成功讀取。 任何可讀檔案都被寫入指定的變數中。

Readfile 基本可用於從儲存在資料夾內的檔案中檢索簡單資料項目。 它通常與Writefile action結合使用。 ReadfileWritefile共同提供基本的資料儲存及檢索功能。 對於進階資料存取,請使用 Sqlselect, Sqlexec, Sqltable, and Sqlcursor.

相依性

出現下列情況時,系統會承受過大負載:

  • 您的業務單元有超過 15 個並行通話。
  • 正在執行的指令碼包含與檔案相關的動作,例如 WritefileReadfileFileexist

這會導致限流。 您的業務單元將在執行指令以及使用其他功能(包括聯絡處理和狀態變更)時遇到延遲,直到積壓的進程完成。

支援的指令碼類型

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 數位的

輸入屬性

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

屬性

描述

Caption

輸入在指令碼中唯一標識此操作的短語。 標題出現在指令碼畫布上的動作圖示下。 The default is the action name.

FileName

檔案的名稱。 該檔案必須位於 CXone Mpowerfile storage中。 如果檔案在一個資料夾中,需包括檔案的路徑。

MaxLength

限制檔案大小 。 您可以選擇 Limit1KLimit2KLimit4KLimit8KLimit16KLimit32K
Variable 要儲存從檔案中讀取的資料的變數的名稱。 預設變數為 BUFFER

ConverttoArray

如果您想將文字檔案的內容轉換為變數中的陣列,請選擇True。 在檔案中,每個陣列元素的內容必須單獨佔據一行。

結果分支條件

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

條件

描述

Default

指令碼未能滿足需要它採用其中一個分支的條件時採用的路徑。 如果沒有定義動作的其他分支,也會採用該路徑。
FileNotFound 無法找到檔案名稱時所採用的路徑。