- 概述
- 应用程序事件
- 流程图生成器
- 标注
- 复杂场景
- 凭据
- Data Service
- 表单
- FTP
- IPC
- Automation Ops 管道
- 暂留
- 系统
- 发行说明
- 项目兼容性
- 受支持的字符编码
- “正则表达式构建器”向导
- 添加数据列
- 添加数据行
- 添加日志字段
- 加减日期
- 添加事务项目
- 添加队列项目
- 将项目附加至集合
- 将项目附加至列表
- 附加行
- 提示音
- 中断/退出循环
- 浏览文件
- 浏览文件夹
- 构建集合
- 构建数据表
- 批量添加队列项目
- 更改文本大小写
- 更改类型
- 检查 False
- 检查 True
- 清除数据表
- 从集合到数据表
- 注释
- 压缩文件/Zip 文件
- 复制文件
- 复制文件夹
- 合并文本
- 注释掉/禁用的活动
- 继续/跳过当前
- 创建文件
- 创建文件夹
- 创建列表
- 自定义输入
- 删除
- 删除文件
- 删除文件夹
- 删除存储文件
- 删除队列项目
- 禁用本地触发器
- Do While 循环
- 从 URL 下载文件
- 下载存储文件
- 启用本地触发器
- 评估业务规则
- 存在于集合中
- 提取/解压缩文件
- 从文本中提取日期和时间
- 提取文本
- 文件更改触发器
- 文件已存在
- 筛选集合
- 筛选数据表
- 文件夹存在
- 遍历循环
- 适用于文件夹中的每个文件
- 文件更改触发器 v3
- 查找和替换
- 查找匹配模式
- 对于文件夹中的每个文件夹
- 对于数据表中的每一行
- 将日期格式设置为文本
- 为值添加格式
- 从文本中生成数据表
- 获取资产
- 获取凭据/获取 Orchestrator 凭据
- 获取当前作业信息
- 获取环境文件夹
- 获取环境变量
- 获取文件信息
- 获取文件夹信息
- 获取作业
- 获取进程
- 获取行项目
- 获取密码
- 获取事务项目
- 获取用户名/密码
- 获取队列项目
- 全局变量更改触发器
- 输入对话框
- 调用代码
- 调用 COM 方法
- 调用 PowerShell
- 调用流程
- 调用 VBScript
- 调用工作流文件
- 是否为文本匹配
- 联接数据表
- 终止进程
- 启动工作流交互
- 列出存储文件
- 日志消息
- 查找数据表
- 手动触发器
- 合并集合
- 合并数据表
- 消息框
- 修改日期
- 修改文本
- 移动文件
- 移动文件夹
- 多重分配
- 向队列新增项目
- 通知全局变量已更改
- Orchestrator HTTP 请求
- 输出数据表
- 并行
- 并行的遍历循环
- 存在路径
- 推迟事务项目
- 流程终止触发器
- 流程启动触发器
- 流程跟踪作用域
- 发出警示
- 读取列表项目
- 读取文本文件
- 读取存储文本
- 删除数据列
- 删除数据行
- 删除重复行
- 从集合中删除
- 删除日志字段
- 替换匹配模式
- 重复次数
- 重复触发器
- 重命名文件
- 重命名文件夹
- 报告状态
- 重置计时器
- 恢复计时器
- 重试作用域
- 返回
- 运行本地触发器
- 运行代理
- 运行作业
- 运行并行流程
- 设置资产
- 发送电子邮件通知
- 设置凭据
- 设置环境变量
- 设置密码
- 设置任务状态
- 设置追踪状态
- 设置事务进度
- 设置事务状态
- 应停止
- 拆分文本
- 数据表排序
- 启动计时器
- 开始作业
- 停止作业
- 停止本地触发器
- 停止计时器
- 左侧/右侧的文本
- 要大写/小写的文本
- 时间触发器
- 触发器作用域
- 跟踪对象
- 超时作用域
- 更新行项目
- 更新列表项目
- 上传存储文件
- 等待下载
- 等待队列项目
- 先条件循环
- 工作流占位符
- 写入存储文本
- 写入文本文件
- 添加数据行
- AddQueueItem
- 添加事务项目
- 附加行
- BulkAddQueueItems
- 清除数据表
- 压缩 Zip 文件
- 复制文件
- 创建文件
- 创建文件夹
- 删除文件或文件夹
- 删除队列项目
- 删除存储文件
- 下载存储文件
- 提取解压缩文件
- 筛选数据表
- 获取资产
- 获取凭据
- GetJobs
- 获取队列项目
- GetQueueItems
- 获取本地路径的资源
- 获取行项目
- 获取事务项目
- 调用流程
- 联接数据表
- 列出存储文件
- 查找数据表
- 合并数据表
- 移动文件
- Orchestrator HTTP 请求
- OutputDataTable
- 存在路径
- 推迟事务项目
- 读取存储文本
- 读取文本文件
- 删除数据列
- 删除重复行
- 替换
- 设置资产
- 设置凭据
- SetTransactionProgress
- 设置事务状态
- 数据表排序
- 开始作业
- 停止作业
- 更新行项目
- 上传存储文件
- 等待队列项目
- 写入存储文本
- 写入文本文件
- 测试
- 发行说明
- 关于“测试”活动包
- 项目兼容性
- 项目设置
- Address
- AddTestDataQueueItem
- AttachDocument
- BulkAddTestDataQueueItems
- DeleteTestDataQueueItems
- GetTestDataQueueItem
- GetTestDataQueueItems
- GivenName
- LastName
- RandomDate
- RandomNumber
- RandomString
- RandomValue
- VerifyAreEqual
- VerifyAreNotEqual
- VerifyContains
- VerifyExpression
- VerifyExpressionWithOperator
- VerifyIsGreater
- VerifyIsGreaterOrEqual
- VerifyIsLess
- VerifyIsLessOrEqual
- VerifyIsRegexMatch
- VerifyRange
- Workflow Foundation

工作流活动
下拉菜单的高级控件
The tutorials on this page demonstrate using drop-down lists with the UiPath Form Designer, inside the Create Form Task activity. The most used property for achieving the results in the tutorials is the FormData(Collection).
创建动态下拉列表
在要发送动态数据以填充表单操作内的下拉控件的工作流中使用它们。
With this method, a variable of the type List of Strings holds the values of the drop-down list instead of adding static values on the Data tab in the UiPath Form Designer.
在以下示例中,我们创建一个国家/地区的动态下拉列表,使用国家/地区列表初始化一个变量,并创建一个附加变量以捕获用户选择的国家/地区。

To create a dynamic drop-down:
- In the Create Form Task activity, click the ellipsis (
...) to the right of FormData. - 为动态下拉列表添加参数,如下所示:
-
名称:
countryList_dropdown -
Direction: In
-
Type: List of Strings (
List<String>) -
Value: Press Ctrl + K and enter
listOfCountriesas the variable name.listOfCountries变量包含下拉列表中的项目。备注:Array of Strings is also supported, but you must manually add the drop-down component in Form Designer and add the Field Key value.
-
- 如果要将用户选择返回到工作流,请添加另一个参数以捕获所选值:
- 名称:
country(下拉组件的字段键) - Direction: In/Out or Out
- Type: String
- Value: Press Ctrl + K and enter
selectedCountryas the variable name.
- 名称:
- Click OK to close Form Data.
- Open the Variables panel and initialize
listOfCountrieswith the default valuenew List(of string) from { "India", "Romania", "US" }.提示:You can also choose to populate
listOfCountriesthrough other activities instead of initializing it.
创建级联下拉列表
如果您希望一个下拉列表(父级)中的选择填充第二个下拉列表(子级)中的值,请在基于任务的表单中使用它们。

要创建级联下拉列表,请执行以下操作:
-
In the Create Form Task activity, click the ellipsis (
...) to the right of FormData. -
将父下拉列表绑定到工作流。
在此示例中,创建一个参数,将
listOfCountries“列表 <String>”变量作为下拉列表传递到工作流。备注:listOfCountries变量包含父级下拉列表中的项目,即国家/地区列表。- 将参数命名为
CountryList_dropdown。此参数的“字段键”属性名称为CountryList。 - 将“方向”设置为“输入”
- 将“类型”设置为
System.Collections.Generic.List<System.String> - 将“值”
listOfCountries<String>设置为 列表变量。
- 将参数命名为
-
将子下拉列表绑定到工作流。
对于此示例,创建一个参数,用于将
stateDictionaryList字典<String,List<String>>变量作为下拉列表传递到工作流。备注:stateDictionaryList变量包含子下拉列表中的项目,即每个国家/地区的州。- 将参数命名为
stateDictList_dropdown。此参数的“字段键”属性名称为stateDictList。 - 将“方向”设置为“输入”
- 将“类型”设置为
System.Collections.Generic.Dictionary<System.String, System.Collections.Generic.List<System.String> - 将“值”设置为
stateDictionaryList字典<String,列表<String> 变量
- 将参数命名为
-
将子下拉列表绑定到父下拉列表。
Create an argument with the name of the child dropdown and add the
_parentsuffix. Then set the Value of the argument to the name of the parent dropdown, like this:”ParentDropdownVariableName”.在此示例中,创建一个名为
stateDictList_parent的参数。 子下拉列表为stateDictList,您需要向其添加_parent后缀。- 将“方向”设置为“输入” 。
- 将“类型”设置为
String。 - 将“值”设置为
”CountryList”。
When populating the
stateDictListDictionary variable, take note that the dictionary Key is a value from the parent drop-down list and its corresponding Value is a list of options to be shown on the form if the parent is set to the key.提示:您可以在FormData集合中传递要预填充的值(例如,使用国家/地区和州字段)。如果要传递子值,请确保还添加了父值,以防止意外行为。
-
Map each value from the parent drop-down to a List of Strings variable. You can populate the list (dictionary) for the parent drop-down in any way, but for this example, we use an Add to Dictionary activity for each value.
- Dictionary: the dictionary of the child drop-down,
stateDictList. - Key: a value from the list of strings for the parent drop-down,
CountryList- in this example,"US","India", and"Romania". - 值:按Ctrl + K并输入一个名称,“字符串列表”变量的名称即可保存在父级中选择键值时要在子下拉列表中显示的值 -
usaStatesList、indianStatesList和romanianCountyList、。
- Dictionary: the dictionary of the child drop-down,
-
Make sure you place the activity or activities for the above step before the Create Form Task activity.
-
Click OK to close Form Data.
-
Open the Variables panel and initialize the new List of String variables you created with the following default values:
- 对于
indianStatesList:new List(of string) from { "Odisha", "Rajasthan", "Karnataka" } - 对于
usaStatesList:new List(of string) from {"Florida", "Georgia", "Washington"} - 对于
romanianCountyList:new List(of string) from {"Cluj", "Prahova", "Constanta"}。
- 对于
从此处下载这些示例
在“编辑网格”和“数据网格”组件中创建级联下拉列表
To use cascaded drop-downs inside a Edit Grid or Data Grid component:
-
Create the drop-down fields following the steps above (using the FormData wizard).
-
打开表单设计器。
-
如果未在表单中创建下拉字段,请验证:
- The
<dropdownKey>,<dropdownKey>_dropdown, and<dropdownKey>_parentarguments are correctly added in the FormData collection. - The GenerateInputFields box is checked.
- The
-
Drag and drop the Edit Grid or Data Grid component.
-
Drag and drop the drop-downs created at Step 1 into the Edit Grid or Data Grid component.
-
打开子下拉列表的配置菜单(单击 )。
-
In the Logic tab, notice the preconfigured advanced logic.

-
Navigate to the Actions > Schema Definition field.
-
将架构表达式中的
[data.<parent_dropdown_key>]替换为[row.<parent_dropdown_key>]。
备注:row关键字指示表单使用网格行中的父项值。
-
保存表单。
设置下拉列表的搜索结果数量
默认情况下,下拉列表最多显示四个搜索结果。 您可以通过在表单设计中设置属性来更改此限制。
To set the number of search results for a drop-down:
- In the UiPath Form Designer, click Edit to open settings for the drop-down list and then select the Data tab.
- Under Choices.js options, add
{ "searchResultLimit" : x }, wherexis the maximum number of results you want to show.
显示下拉列表中的所有选项
如果下拉菜单中的字符串超过 50 个字符,则系统可能会忽略这些字符。
要显示与您的搜索词匹配的所有选项,请执行以下操作:
- 单击“编辑 JSON”
要编辑的下拉列表组件的名称。 - In the Component JSON field, add the following properties:
... "fuseOptions": { "distance": 800, }, "threshold": 1, "useExactSearch": false, ...... "fuseOptions": { "distance": 800, }, "threshold": 1, "useExactSearch": false, ...
threshold属性指定算法在哪个点停止给定搜索词的搜索操作。例如, 0的threshold需要字母和位置精确匹配。1的threshold可以匹配任何内容,甚至包括拼写错误。根据您的用例调整threshold值。