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:
-
Add the Create Form activity to your workflow.
-
Inside the Do block, configure the desired activities.
-
Open the Form Designer from the Create Form activity.
-
Drag and drop a Drop-down List component.
-
In the Data tab > Data Source Values section, add your dropdown options.
-
Scroll down to the Custom Default Value section and expand it.
-
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);
}The code snippet above triggers the execution of the activities from the Do block when the dropdown option changes.
-
Save the form.
-
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