Loading...

Adding Dynamic Rules to Workflow Forms

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

  1. In the Rules tab, under the rules order list, click Add rule.
  2. 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.

    1. Select form is.
    2. From the list, select Opened.

    Apply the rule when the user cancels the form.

    1. Select from is.
    2. From the list, select Cancelled.

    Apply the rule when the user submits the form.

    1. Select from is.
    2. From the list, select Submitted.
  3. 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.
  4. 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.

    1. From the inputs list, select the input name.

      Two additional fields appear next to the input name.

    2. 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.

    3. 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.

    1. From the inputs list, select Custom Script.
    2. 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.

  5. 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.

    1. From the actions list, select show.
    2. From the fields list, select the field name to show.

    Hide

    Hide a form input.

    Hide the input from the form.

    1. From the actions list, select hide.
    2. 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.

    1. From the actions list, select require.
    2. 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.

    1. From the actions list, select make optional.
    2. 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.

    1. From the actions list, select disable.
    2. 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.

    1. From the actions list, select enable.
    2. 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.

    1. From the actions list, select change.
    2. From the field list, select the field name to change.
    3. 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.

    1. From the actions list, select display a message.
    2. In the box to the right, enter the message you want to display to the user.
    3. From the top list to the right of the message box, select the type of message you want to display.
    4. 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.

    1. From the actions list, select fail validation.
    2. 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.

    1. From the actions list, select custom script.
    2. 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.

  6. Ensure that the Enabled check box is selected, and then click OK.

    The new rule appears at the bottom of the rules order list.

  7. 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.

Last modified: 9/12/2019 6:37:38 PM