You can add rules to control various aspects of the workflow form user experience. For example, if a user enters incorrect information in a form, you can display a message. You can also show or hide inputs based on the selections or other inputs given by the user.
Procedure
Choose where you want to add a rule:
For a workflow, open the properties.
For a user interaction activity, open the properties.
On the Inputs tab, click Advanced Customization.
The Advanced Customization dialog box appears.
Click Add Rule.
For Match below groups when, specify when to apply the rule:
To reapply the rule when the user changes the value of any input field in the form, select field changes.
To apply the rule when the user opens the form, select form is and Opened.
To apply the rule when the user cancels the form, select form is and Cancelled.
To apply the rule when the user submits the form, select form is and Submitted.
Specify when to apply the rule actions:
To apply the rule actions only when all the conditions are met, from the Match list, select all.
To apply the rule actions when one or more of the conditions are met, from the Match list, select any.
Click Add condition, and then configure one or more conditions based on input values to control when to apply the rule actions.
Goal | Steps |
---|---|
Set a condition based on the value of the input or if the input value changes. |
|
Set a condition based on custom JavaScript code. The code must return a Boolean (true or false) value. Tip: You can select form inputs using the CSS id selector (#) and the input name. For example, if the input name is UserName, you can use the JQuery selector $('#UserName') to select the input. |
Tip: To automatically insert inputs as variables in the script, click the ellipse button |
Under Actions, click Add action, and then configure one or more actions to apply to the form if the conditions are met.
Goal | Steps |
---|---|
Show the input on the form. |
|
Hide the input from the form. |
|
Allow the user to submit the form only if they enter data into a form input. |
|
Allow the user to submit the form with or without entering data into a form input. |
|
Make the user unable to enter data into a form input. |
|
Allow the user to enter data into a form input. |
|
Automatically populate or change an input value. |
|
Display an informational, error, or warning message to the user that the user can confirm or cancel. |
|
Make the user unable to submit the form based on certain input values. |
|
Set a condition based on custom JavaScript code. The code must return a Boolean (true or false) value. Tip: You can select form inputs using the CSS id selector (#) and the input name. For example, if the input name is UserName, you can use the JQuery selector $('#UserName') to select the input. |
Tip: To automatically insert inputs as variables in the script, click the ellipse button |
Verify that the Enabled check box is selected, and then click OK.
The rule appears at the bottom of the rules order list.
To adjust the order of how the rule is applied, click the rule and use the up and down arrows to change the order of the rules.