activities
latest
false
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。
UiPath logo, featuring letters U and I in white

工作流活动

上次更新日期 2026年3月9日

在下拉选项更改时执行“执行”块

You can configure activities inside the Do block to execute when the dropdown option changes.

教程

要使用此功能,请执行以下操作:

  1. Add the Create Form activity to your workflow.

  2. Inside the Do block, configure the desired activities.

  3. Open the Form Designer from the Create Form activity.

  4. Drag and drop a Drop-down List component.

  5. In the Data tab > Data Source Values section, add your dropdown options.

  6. Scroll down to the Custom Default Value section and expand it.

  7. In the JavaScript subsection, enter the following JavaScript code:

    const updateOnChange = instance.updateOnChange;
    instance.updateOnChange = function(flags, changed) {
        if (flags.modified) {
            instance.emit('dropdownChanged', 'drop');
        }
        return updateOnChange.call(instance, flag, changed);
    }
    const updateOnChange = instance.updateOnChange;
    instance.updateOnChange = function(flags, changed) {
        if (flags.modified) {
            instance.emit('dropdownChanged', 'drop');
        }
        return updateOnChange.call(instance, flag, changed);
    }
    

    当下拉选项更改时,上面的代码片段会触发执行“执行”块中的活动。

  8. 保存表单。

  9. At runtime, when you change the dropdown option, notice the activities in the Do block being executed.

示例工作流

要查看完整的工作流或供日后参考,请下载XAML 示例

  • 教程
  • 示例工作流

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新