Vlocity Facts #42 || How to use Decision Matrix in OmniScript

In one of the previous posts DataMapper Extract Function and Formulas and by using IF(Condition)
I have combined 'Dialing Code' and 'Phone Number'.

It is okay for limited countries but if you are going to use application across the world then it will be difficult in those scenarios. We can use 'Decision Matrix'.
In this post will explain how to create and use decision matrix in omniscript. [Just an example]


1. From App launcher open Business Rule Engine.
2. Click 'New' button and choose 'Decision Matrix', fill details by selecting type as standard.

3. Navigate to related tab and open the 1st version you created now. By using Add Row, Add Column you can add columns, rows.
4. While we add 'Columns' will get option to choose whether it is input or output and Data Type.
5. After adding columns now we need to add rows to mention input and output for the matrix.
6. After filling all the details save the Matrix and activate it by clicking 'Edit' button from top right side.
Note: You can upload your data throw excel by using 'Upload CSV File' button, if you have same columns in excel and matrix and you can download the matrix from 'Generate CSV File' button.
---------------------------------------------------------------------------------------------------------------------
Navigate to your omniscript.
Consider the example which we discussed starting, we need to pass the country name to decision matrix and it will give you the Dialing Code as Output.
 
I have created one step which uses TypeAhead block with Google Maps - configuration.
[Reference post which i have discussed before Configure Google Maps in Type Ahead Block]
I used decision matrix after this step by passing the details [Data Source, Filter] from Google Address block.
Drag and drop the 'Decision Matrix' to the canvas and map the Data Source and filter values under Matrix Input Parameters.
Data Source: You can pass the input to 'Decision Matrix'. 
Filter: Input Parameter what we have mention in Matrix [In our scenario - we named it as 'Country'] use the same name in filter.
And select the Matrix from Remote Properties

Note: Will get decision matrix Output in json we can use that node in our requirements.
Now Combine both Phone number and Country Code[Dialing Code] which we get as a Output from Decision Matrix by using Set Value.
CONCATENATE(%CountryCode%,%NewApproach:PhoneNumber%)

Create one more step to preview the details.

After creating steps, decision matrix, set values canvas will look like this.
-------------------------------------------------------------------------------------------------------------------
Preview the omniscript and fill the details.
Proceed to next after filling the details, decision matrix will execute and gives the Country Code [Dialing Code] as a Output.
Country: United States is passed as a input to 'Decision Matrix'.
Received Output as '+1' which the dialing code for US and i have mentioned the same in Matrix table.
-----------------------------------------------------------------------------------------------------------------------
Other Scenarios where we can use Decision Matrix. Case Creation scenarios where we can assign the Milestones based on the conditions or Assigning the cases to the Queues. [Based on multiple Inputs]
In flows also we can invoke decision matrix. 
In Calculation procedures also we can use 'Decision Matrix'.










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]