You are here:
Customize Omniscript Error Messages
The error message handler enables you to replace default error messages from remote apex calls with more user-friendly error messages when errors occur in Omniscript. The Error Messages handler property is available in File elements, Image elements, all Action elements, and Setup.
Error Messages set in the Setup properties apply to any matching error returned by an element, while Error Messages set in an Action’s properties only render for that Action.
Error Message Type |
Description |
|---|---|
Default Error Message |
A default message that returns when no Custom Error Messages are matched or defined. |
Custom Error Messages |
Messages that are returned based on the defined path and value. Custom Error Messages are configured using the following fields:
|
Set the Default Error Message on an Omniscript Element
Replace a Default Error Message with a user-friendly error message when a remote apex call error occurs in your Omniscript. A default message returns when no custom error messages are matched or defined. Update the default error messages for Image, Action, and File elements.
Before You Begin
Before configuring Error Messages, preview the errors to determine their format.
- Open the Error Messages property in the element that renders the error.
- In the Default Error Message field, enter your custom message.
- Preview the error to ensure the message renders.
Set a Custom Error Message That Returns as an Object
Set a Custom Error Message for an error that returns as an object. A Custom Error Message returns based on a defined path and value. Set custom error messages for File elements, Image elements, all Action elements, and Setup.
Before You Begin
Before configuring Error Messages, preview the errors to determine their format.
- Run the Omniscript to encounter the error.
-
Determine the path to the error. For example, the path for errorCode in the following error
[{"errorCode":"NOT_FOUND","message":"The requested resource does not exist"}]is . -
Copy the error message text that follows the path. For example, the error message text for errorCode in the following error:
[{"errorCode":"NOT_FOUND","message":"The requested resource does not exist"}]is NOT_FOUND . - Open the Error Messages property in the Action Element that is rendering the error.
- In the Path field, enter the path determined by Step 2.
- In the Value field, paste the original error.
- In the Message field, enter your custom message.
- Test to ensure the message is being replaced.
Set a Custom Error Message That Returns as a String
Set a Custom Error Message for an error that returns as a string. A Custom Error Message returns based on a defined path and value. Set custom error messages for File elements, Image elements, all Action elements, and Setup.
Before You Begin
Before configuring Error Messages, preview the errors to determine their format.
- Run the Omniscript to encounter the error.
- Copy the text following the colon after the word Error.
- Open the Error Messages property in the Action Element that’s rendering the error.
-
In the Path field, enter the path to the original error
using a merge field syntax.
For example, to reference the error message in this JSON string:
{ "errorMessage" : "An Error has occured in an apex class", "error" : "OK" }Enter errorMessage in the Path field.
If the JSON string is more complex such as:
{ "errors" : [ { "errorMessage" : "An error has occured. " }] }Enter errors|0:errorMessage in the Path field.
- In the Value field, paste the original error.
- In the Message field, enter your custom message.
- Test to ensure the message is being replaced.

