Readfile

将文件中的数据读取到本地变量中。此作尝试读取 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 当无法找到文件名时采用的路径。