OmniStudio Calculation Procedures and Calculation Matrices

Share on facebook
Share on twitter
Share on linkedin

In OmniStudio, Calculation Procedures are used to configure complex math. A Calculation Procedure can call up several Calculation Matrix files to handle variable input values and calculations.  

Calculation Matrices 

A lookup table that takes a unique set of inputs or input and returns a set of outputs or output. 

Types of Calculation Matrices 

  • Standard Calculation Matrix: This is used when you do not need to group your matrix or version it row by row. 
  • Grouped Calculation Matrix: This is used to group matrices that have the same Input and Output headers together. 
  • Row-Versioned Calculation Matrix: This is used if your matrix has many rows and may need to do a small data change at a time. Each row in the matrix has its start date and time. 

Build Calculation Matrix: 

Before building the calculation, we need to prepare an excel with base data matrix in a CSV format to upload it on Calculation Matrix. 

  • Select the OmniStudio app from the App Launcher by clicking the setup icon 
  • Select Vlocity Calculation Matrices from the dropdown and then click New from options.  
  • Confirm Standard and then click Next, if needed. 
  • Enter Name on the Calculation Matrix Name field and click Save. 
  • Select the Related sub-tab and click to access the recently created calculation matrix with V1 on the Vlocity Calculation Matrix Versions related list. 
  • Click on Upload CSV to upload the data in the matrix. 
  • Next, we need to map header type, data type, and display the order of the data imported from excel. 
  • To review the data, click Edit Data. Matrix inputs or sets of inputs (combinations of inputs) should be unique. But outputs do not need to be unique, and Matrices can have multiple output fields. 
  • Click Save Data. Calculations and Matrices need an explicit save. 
  • If visible, click Show All Rows. The Button changes to Show Errors Only and you can confirm there are no errors. 
  • At the top of the screen, click the Edit action button (you may have to click the down arrow to view it). 
  • Select the Enabled checkbox. 
  • Click Save

Calculation Procedure 

The OmniStudio Calculation Procedures allow you to combine several numerical operations and transformations at the same time. Formatted JSON has been taken as input and performs lookup matrices, algebraic operations, and aggregations to bring out new outcomes. 

In Calculation Procedures, you need to configure matrix lookups, set variables, and constants, and do basic math. 

Build Calculation Procedure 

  • Select the OmniStudio app from the Lightning App Launcher  
  • Select Vlocity Calculation Procedures -> Click New. 
  • Enter Name of Calculation Procedure in the Calculation Procedure Name field and click Save. 
  • Click Related > Choose the recently created Calculation procedure to open it. 
  • Lookup the Calculation Matrix 
  • Click +Add step under the calculation steps section. 
  • Select Matrix Lookup and Choose the calculation matrix by typing the name of it. 
  • Graphical user interface, text, application

Description automatically generatedSelect Include in calculation Output checkbox under the output variable populated from the select calculation matrix to make it available for calculation.  
  • Graphical user interface, application

Description automatically generatedAdd Variables and Constants by clicking + Add Variable / + Add Constant and using them to build the Calculation Step based on the business need. 
  • Also Under the Calculation steps section. We could able to add the calculation by selecting the Calculation option, where you could able to build the formula based on your input and output  
  • Add an aggregation step to get an aggregated result of your output from the calculation matrix 

Now, we are done with creating the Calculation Matrix and Calculation Procedure. Let us know how to test it. 

  • To test the procedure, use Simulate subtab. 
  • Enter the effective date (in the future) and the sample input data. 
  • Clicking Simulate all steps will show the output result. 
  • Graphical user interface, application

Description automatically generatedTo build a Data Raptors, use the resulting sample input and output JSON. 

Notes:  

  • Versioning for Calculation Procedures and Calculation Matrix are the same.  
  • The Calculation Procedure version is valid between the start time and end time, and if multiple versions are valid, then the highest priority will run (1 is the lowest priority).  
  • You can have multiple versions, and they will automatically roll over. 

Reference Link: 

About the Company: 

MST Solutions, Salesforce certified partner, is one of the Great Place to Work, which expresses its streaming talents in various CRM solutions like MuleSoft integration, marketing automation, manufacturing, the public sector, and others. As its core values stay with colleagues, customers, community, our focus will be on customer satisfaction and providing a better solution and a quality product for their business requirements. 

 

About MST

At MST Solutions our cornerstone is to adapt, engage and create solutions which guarantee the success of our clients. The talent of our team and experiences in varied business verticals gives us an advantage over other competitors.

Recent Articles

Work with us.

Our people aren’t just employees, they are key to the success of our business. We recognize the strengths of each individual and allow them time and resources to further develop those skills, crafting a culture of leaders who are passionate about where they are going within our organization.