Activities
latest
false
Banner background image
Workflow Activities
Last updated Apr 22, 2024

Executing Do Block on Dropdown Option Change

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

Tutorial

To use this feature:

  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);
    }

    The code snippet above triggers the execution of the activities from the Do block when the dropdown option changes.

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

Sample workflow

To check the complete workflow or to have a future reference, download the XAML example

  • Tutorial
  • Sample workflow

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.