activities
latest
false
Workflow Activities
Last updated Oct 31, 2024

Executing Do Block On Checkbox Change

You can configure activities inside the Do block to execute when a specific checkbox in the form is checked or unchecked.

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 Checkbox component.
  5. In the Data tab, click ** Calculated Value**. This expands a list of fields.
  6. In the JavaScript field, enter the following JavaScript code:

    const updateOnChange = instance.updateOnChange;
        instance.updateOnChange = function(flags, changed) {
              if (flags.modified) {
               instance.emit('execute', instance.component.key , {});
              }
    }const updateOnChange = instance.updateOnChange;
        instance.updateOnChange = function(flags, changed) {
              if (flags.modified) {
               instance.emit('execute', instance.component.key , {});
              }
    }
Note: The code snippet above triggers the execution of the activities from the Do block based on the checkbox change.

7. Save the form.

8. At runtime, when you make changes to the checkbox, notice the activities in the Do block being executed.

Result

When you select the Checkbox component, the Do block executes. For this example, when you select the Checkbox component, a Message Box pops up.

Important: Known issue: The Do block executes twice: when you select the Checkbox component and when you submit the form.

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.