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 Admin Interview Questions: The Complete Guide
September 18, 2025

Salesforce Admin Interview Questions: The Complete Guide

Salesforce Admin Interview Questions guide: Get scenario...

Salesforce Developer Interview Questions
October 8, 2025

Salesforce Developer Interview Questions

Preparing for a Salesforce Developer Interview Questions...

Salesforce billing vs revenue cloud: What’s the Difference?
September 27, 2025

Salesforce billing vs revenue cloud: What’s the Difference?

In today’s hyper-digital and fast-moving market, companies...

Revenue Cloud Advanced for Subscription Businesses: Real Use Cases
January 7, 2026

Revenue Cloud Advanced for Subscription Businesses: Real Use Cases

Picture this: It’s month-end, and your finance team...

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...

Vlocity Environment Variable Guide with Examples and Use Cases
June 11, 2025

Vlocity Environment Variable Guide with Examples and Use Cases

Understanding how to use a Vlocity Environment Variable...