Vlocity Facts #09 | Set Errors and Set Values

Set Errors In an OmniScript

Using the Set Errors action element, add error or validation messaging to one or more elements in a previous step based on conditions from subsequent steps. You can only set requirements and conditions on elements in the current step when using required fields and Formula/Messaging elements.

For example, on an application,  I have 15 fields on first step in that three fields are [ Phone number, Email, Postal Code] and those fields are not required in the initial intake step, and in a future step, I have a three check box related stating may of communicating with [ Email, Phone, Address] if user choose through phone but user has not given any value to in first step in this case we can use Set Errors element,  It runs after the step and returns the user to the initial intake step with custom error messages.

Note: File, Image, Messaging, and Formula these elements are not supported by Set Error element.

How to configure Set Error elements: 

  • Conditional View: The error will remain in the OmniScript without a conditional view so we need to mention conditional view. 
  • Element Error Map: In Element error map you can mention the field name where error message should be displayed. 
      Element Name - Particular Element name like [Email, Phone, Postal code]
      Value -  Custom Error message or We can use merge syntax.
============================================================================
Set Values In an OmniScript
Using the Set Values Action, you can set element values in subsequent steps, rename JSON nodes, create dynamic values, and concatenate data. When in a Step, action elements either render as a button or run remotely when in between steps. Set Values makes use of merge fields to gain access to the OmniScript's data JSON.

We can use Set Value Actions when we need :
  • Populating Elements with values, both Field and Set value elements name should same 
  • Set values sent into the data JSON from a response or parameter
  • Access and rename data JSON by using merge fields.
  • Make values using OmniScript Functions and Supported Formula Operators.
  • Concatenate Values
===============================================================================
 Application Scenario with the Combination of Set Error and Set Values.
In First Step we have Information related elements
In Second Step we need to choose way of communication with the user 
Now we need to create set values to check whether email, Phone, Postal Code fields are null or not 
  • For Email : IF(%Review:Checkbox1%=true&&%Information:Email1%=null,"Notok","ok")
  • For Phone : IF(%Review:Checkbox2%=true&&%Information:Telephone1%=null,"Notok","ok")
  • For Postal Code: IF(%Review:Checkbox3%=true&&%Information:PostalCode%=null,"Notok","ok")
Now we need to create set error to display the error message on respective field or element.
For Email: Configuration/Conditional View

For Phone : Configuration/Conditional View

For Postal Code: Configuration/Conditional View
==============================================================================
After Configuration our omniscript looks like this 


After user clicks on next then it will navigate back to first step and Custom error message will be displayed under particular field what you have mention in set error.


Note: Instead of using multiple set values by using single set value also we can achieve this.















 


Comments

Popular posts from this blog

Vlocity Facts #01 | OmniStudio DataRaptors

Vlocity Facts #34 || Getting the details from the URL in a FlexCard and an Omniscript

Vlocity Facts #44 || Communication between Omniscript and Flexcard [Pub/Sub]