From the Dynamic Form Rules page, you can add rules to control various aspects of the workflow form user's experience.
For example, if you determine that a user had entered the wrong information in a form, you can display a message with a corrective statement to the user. You can also show or hide different inputs based on the selections or other inputs given by the user.
Procedure
-
In the Rules tab, under the rules order list, click Add rule.
-
Under Rule #number, select a general condition for when to apply the rule.
-
Option
Description
Goal
Steps
Match below groups when {field changes|the form is {Opened|Cancelled|Submitted}}
The condition for when to apply the rule during in the lifecycle of the form.
For example, if you choose Match below groups when field changes, then the form rule is applied whenever the user changes the value of any input field in the form.
Reapply the rule whenever the user changes the value of any input field in the form.
- Select field changes.
Apply the rule when the user opens the form.
-
Select form is.
-
From the list, select Opened.
Apply the rule when the user cancels the form.
-
Select from is.
-
From the list, select Cancelled.
Apply the rule when the user submits the form.
-
Select from is.
-
From the list, select Submitted.
-
Under Condition Group, select one of the logical operators from the list to control when to apply the rule actions:
-
Select Match all of the following conditions to apply the rule actions only if all of the conditions are met.
-
Select Match any of the following conditions to apply the rule actions if at least one of the conditions are met.
-
-
Click Add Condition, and then configure one or more conditions based on input values to control when to apply the rule actions.
-
Condition parameter from the list
Description
Goal
Steps
form input name.
One of the form input fields as defined in the workflow.
Set a condition based on the value of the input or if the input value changes.
-
From the inputs list, select the input name.
Two additional fields appear next to the input name.
-
From the second list, select the operator to use for the input value.
For example, to set a condition for when the form contains a certain string, select contains.
-
If the operator you selected requires a value, in the third box, enter the value to use.
Custom Script.
A custom JavaScript function.
Set a condition based on custom JavaScript code. The code must return a Boolean (true or false) value.
Note
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.
-
From the inputs list, select Custom Script.
-
In the box that appears, enter the function to use as the condition.
Tip
To automatically insert inputs as variables in the script, click the ellipse (...) button to the right of the code box and then click the variable that you want to insert.
-
-
Under Actions, click Add action and then configure one or more actions to apply to the form if the conditions are met.
-
Action from the list
Description
Goal
Steps
Show
Show a form input.
Show the input in the form.
-
From the actions list, select show.
-
From the fields list, select the field name to show.
Hide
Hide a form input.
Hide the input from the form.
-
From the actions list, select hide.
-
From the fields list, select the field name to hide.
Require
Make a form input required.
Allow the user to submit the form only if they enter data into a form input.
-
From the actions list, select require.
-
From the fields list, select the field name to make required.
Make optional
Make a form input optional.
Allow the user to submit the form with or without having to enter data into a form input.
-
From the actions list, select make optional.
-
From the fields list, select the field name to make optional.
Disable
Disallow the user to enter data into a form input.
Make the user unable to enter data into a form input.
-
From the actions list, select disable.
-
From the fields list, select the field name to disable.
Enable
Allow the user to enter data into a form input.
Enable the user to enter data into a form input.
-
From the actions list, select enable.
-
From the field list, select the field name to enable.
Change
Change the value of a form input.
Automatically populate or change an input value.
-
From the actions list, select change.
-
From the field list, select the field name to change.
-
In the to box, enter the value that you want to insert.
Display a message
Display a message or confirmation modal in the form.
Display an informational, error, or warning message to the user that the user can confirm or cancel.
-
From the actions list, select display a message.
-
In the box to the right, enter the message you want to display to the user.
-
From the top list to the right of the message box, select the type of message you want to display.
-
From the bottom list to the right of the message box, select the confirmation options for the message.
Fail validation
Automatically fail validation and display an error message.
Make the user unable to submit the form based on certain input values.
-
From the actions list, select fail validation.
-
In the box to the right, enter the message you want to display to the user.
Custom script
A custom JavaScript function.
Set a condition based on custom JavaScript code. The code must return a Boolean (true or false) value.
Note
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.
-
From the actions list, select custom script.
-
In the box that appears, enter the function to use as the action.
Tip
To automatically insert inputs as variables in the script, click the ellipse (...) button to the right of the code box and then click the variable that you want to insert.
-
-
Ensure that the Enabled check box is selected, and then click OK.
The new rule appears at the bottom of the rules order list.
-
If you want 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.