Vlocity Facts #07 | OmniScript Elements -1
In this post i will let you know how to use some of Omniscripts elements and Conditional view for those elements with Scenario.
- Step
- Password
- Formula
- Text Block
- Messaging
- Date
Step:
In your OmniScript if you are having 3 pages to collect or display the data like Personal Details, General Information and Account Details, Each "page" of the form should be created using steps. Steps can be navigated through by using the Next and Previous buttons. You can enable field validation for a Step, which means that all required fields on the Step must be filled out before proceeding.
Step Properties:
In your OmniScript if you are having 3 pages to collect or display the data like Personal Details, General Information and Account Details, Each "page" of the form should be created using steps. Steps can be navigated through by using the Next and Previous buttons. You can enable field validation for a Step, which means that all required fields on the Step must be filled out before proceeding.
Step Properties:
- Chart Label : It is used to display the name of your step it will override the Field name what you have mention.
- Instruction : It is used to add the detail description of the step, you can include Images, Table, Format or Style the test.
- Button Properties : Here you can add or remove the Previous, Next , Save for latter or you can change the names of the buttons.
- Hide Step Chart : This a check box - it will help you to remove the Step chart from the UI if it is checked. You can find this check box in 'Setup'.
- Step Chart Placement: This is a picklist from the drop down you can select "Right, Left, Top" based on your selection the Chart label will be displayed on the UI. You can find this in 'Setup'.
Password:
Add the Password element to your OmniScript to allow users to enter a password. Set the password's minimum and maximum lengths. In validation options we can we can mention Pattern (we can mention regular expressions) and Pattern error text message.
Add the Password element to your OmniScript to allow users to enter a password. Set the password's minimum and maximum lengths. In validation options we can we can mention Pattern (we can mention regular expressions) and Pattern error text message.
Formula:
The Formula element performs calculations that require complex operations. We can choose Data Type [Default, Date, Boolean, Currency, Number, Text] and In Expression we can use Omniscript elements or Data Json, Number, Integers, Strings, Boolean, Arrays.
The Formula element performs calculations that require complex operations. We can choose Data Type [Default, Date, Boolean, Currency, Number, Text] and In Expression we can use Omniscript elements or Data Json, Number, Integers, Strings, Boolean, Arrays.
- By using 'Hide' check box you can hide the formula from UI.
Text Block :
The Text Block and Disclosure element instructions use a Rich Text Editor to display HTML in an OmniScript. In addition to standard Rich Text Editor features, you can:
- Upload files and images to Salesforce Documents (up to 1 MB). Files upload to the public Vlocity Document Uploads folder and are set to Externally Available.
- Link to files and images from Documents.
- Insert Smart Links to Salesforce Knowledge articles.
- Reference data JSON using merge fields.
Messaging Element:
Depending on whether the validate expression returns true or false, display comments, requirements, success, and caution information by using messaging element. It supports merge field syntax also.
Depending on whether the validate expression returns true or false, display comments, requirements, success, and caution information by using messaging element. It supports merge field syntax also.
- Show Message As : Display message as Inline or Toast.
- We can choose Success, Comment, Requirement, warning based on your Use case.
- Validate Expression: Based on this expression Messaging element will display the different types of message.
- Conditional View: Here you can mention the expression based on this expression your message will be displayed on the UI.
Date:
Enable users to select a date from a date picker by adding a Date element to your OmniScript. Set the minimum and maximum dates, and the date format.
Enable users to select a date from a date picker by adding a Date element to your OmniScript. Set the minimum and maximum dates, and the date format.
- Minimum Date: Enter the earliest date the user can select from the date picker.
- Maximum Date: Enter the latest date the user can select from the date picker.
- Date Format: Enter the format to display the date. [MM-DD-YYYY, DD-MM-YYYY]
- In your requirement you need to stop the users to pick the past date. For this you can mention Today() in minimum date field.
- If their is a use case you need to add one year to the value what user has selected from the date field, you can use MOMENT function in formula field to update the date.
In Expression of formula element mention like this to add one year: MOMENT(%DateFiled%).add(1,'year').subtract(1,'day')
Scenario :
If their is a Use case where you need to create a Users for portals. By using password Input Element with Patter you are not able to tell the user exactly what they are missing in password. we can achieve this use case by using password, message, text block, formula with conditional view.
If their is a Use case where you need to create a Users for portals. By using password Input Element with Patter you are not able to tell the user exactly what they are missing in password. we can achieve this use case by using password, message, text block, formula with conditional view.
Steps:
4.Now drag and drop the messaging element and mention the validation expression, conditional view and mention success and requirement for true, false.
5. Now mention conditional view for each text block by using formula elements in the view condition.
a. For upper case text block mention like this :
b. For Lower case text block mention like this:
c. For Special Character text block mention like this:
d. To check at least 8 characters text block mention like this.
e. For one number text block mention like this:
After completion of all 5 steps your canvas will look like this
- Drag Password Element to the canvas and mention the Element name and Field name.
- Now we need to drag 6 Text block elements into the canvas.
a. First Text block element is used to show the heading "Passowrd Should contain the Following Details :" in edit rich text.
b. Second Text block element is used to show the point "Should Contain Upper Case Letter" in edit rich text.
c. Third Text block element is used to show the point "Should Contain Lower Case Letter".
d. Fourth Text block element is used to the show the point "Should Contain At least 8 Characters".
e. Fifth Text block element is used to show the point "Should Contain Number".
f. Sixth Text block element is used to show the point "Should Contain Special Character". - Now need to drag 5 formula elements to check whether the password element contains those required points or not.
4.Now drag and drop the messaging element and mention the validation expression, conditional view and mention success and requirement for true, false.
5. Now mention conditional view for each text block by using formula elements in the view condition.
a. For upper case text block mention like this :
b. For Lower case text block mention like this:
c. For Special Character text block mention like this:
d. To check at least 8 characters text block mention like this.
e. For one number text block mention like this:
After completion of all 5 steps your canvas will look like this
Note: In OmniScripts, validation runs when a user clicks out of a field by using the onBlur function. To enable the OmniScript to run validation when a user types.
- Navigate to Setup and add "commitOnChange":true.
Working Scenario Screen shots:
- For more Details about DataRaptors and Types check this link DataRaptors
- Check here for How to launch Omniscripts
- Best Practices of OmniScript, Integration Procedure, Data Raptors
- For More Vlocity Resources
Comments
Post a Comment