To handle potential end-user errors, add an error or validation message on one or more elements in a previous step based on conditions from future steps with the Set Errors element. For example, an email address isn't required during the initial step, but in a future step, the user states that they wish to be contacted by email. The Set Errors element runs after the step and returns the user to the initial step with custom error messages.
- The name of a Set Errors element must be unique within an Omniscript and all the reusable Omniscripts it uses.
- The Set Errors action element doesn’t support File, Image, Messaging, and Formula elements and doesn’t support custom labels.
- Use the Set Errors element if the validation depends on multiple steps in the Omniscript. If you want to use the required field or a formula or messaging element for validation, you can only set requirements and conditions on elements in the current step.
- Avoid using the Set Errors element for validations in a repeat block. In such cases, use a Messaging element. See Display Messages in Omniscripts.
Note When Set Errors is used, it results in two distinct behaviors. First, the error message
on an input is transient, which means, it vanishes when the user clicks away from the field
but reappears if they try to proceed by selecting Next, if not fixed. Second, if Set Errors
is used on multiple inputs, the errors are shown sequentially rather than all at once. The
subsequent set of errors will only be shown after the first set of triggered errors has been
resolved.
- From the elements panel, drag the Set Errors element to the canvas.
-
Add a conditional to control when the Set Errors message displays.
Without a conditional the error persists in the Omniscript. See Conditionally Display Omniscript Elements.
-
To set the validation for the Set Errors element:
- In the Element Error Map section, click Add Element Value.
- Select the name of the element for which you want to set up validation.
- In the Value field, enter the error message that displays to the user.
- If necessary, select an expression for the element value and enter the validation expression in the Value field.