Skip to content
IP, Omnistudio, Salesforce

try-catch block in Integration Procedure

November 25, 2024

Integration Procedures (IP) in Salesforce OmniStudio, a try-catch block is used to handle exceptions or errors that might occur during the execution of an integration procedure.

  • try block: This section of the code contains the operations or actions you want to perform. If any error occurs during these operations, the execution will jump to the corresponding catch block.
  • catch block: If an error occurs in the try block, the catch block catches the exception and allows you to handle it gracefully. This could involve logging the error, sending a message, or performing any other necessary actions without stopping the entire process.

Example of Usage:

In an IP, the try-catch block isn’t part of the declarative configuration but can be used in scripts or custom logic via Apex actions or within DataRaptors if the logic allows for exception handling. Lets create try-catch block in IP.

Here, I am using Datamapper for extracting contact details using Id. We will add failure execution formula, which means if condition is failed in execution formula, In that case  catch block will executed.

  1. Create a new IP and drag try-catch block into elements from available components.

Now drag the extract datamapper into try-catch block.

Now, Suppose we want to add  condition for data raptor extract and if that condition fail then it will display error message from catch.

Now, If above formula is failed then it will go to try catch, see below screenshot for failure message.

Drag Response action that would contain our Datamapper output.

Now, preview the IP and pass correct contact Id for success of datamapper.

Now, pass incorrect contact Id or whatever input that  makes true the failure execution formula for testing catch block on failure.Below is screenshot of failure message.

In above scenario, I passed empty contact Id which fails the formula and enters into catch block.

This approach ensures that your Integration Procedures are more resilient, reliable, and user-friendly, even when facing unexpected issues during execution.

Keep Reading

Related Articles and Resources

Salesforce Billing Specialist Superbadge challenge Revenue Cloud
September 29, 2025

Salesforce Billing Specialist Superbadge challenge Revenue Cloud

Revenue Cloud by Salesforce lets businesses drive growth...

Salesforce Winter ’26 Release: What Changed and Why It Matters
November 28, 2025

Salesforce Winter ’26 Release: What Changed and Why It Matters

TL;DR: Winter ’26 is a big one. Agentforce (autonomous AI...

Your Guide to Becoming a Certified AI Specialist in Salesforce (Part-1)
November 5, 2024

Your Guide to Becoming a Certified AI Specialist in Salesforce (Part-1)

The demand for AI in the Salesforce ecosystem is rapidly...

How to Create Test Data in Apex Using Mock API Responses?
July 5, 2025

How to Create Test Data in Apex Using Mock API Responses?

How to create test data in apex using Mock API Responses?...

List Merge using Datamapper Formula
November 16, 2024

List Merge using Datamapper Formula

Suppose we have 2 lists in our output json but we want it...

Products catalog Salesforce Revenue Cloud Advance
September 27, 2025

Products catalog Salesforce Revenue Cloud Advance

In the following article we’re going to present a Product...