Master all debugging techniques for Salesforce OmniScript - from built-in tools to advanced browser debugging and third-party solutions
OmniStudio provides two primary built-in debugging tools directly within the OmniScript Designer. These tools are your first line of defense when troubleshooting OmniScript issues.
The Data JSON panel displays the real-time data structure formed by JSON code during OmniScript execution, as detailed in OmniScript advanced concepts.
Displays a searchable log of every action that runs, with detailed request/response data per Salesforce best practices.
The Preview functionality offers several debugging-adjacent capabilities as shown in the Trailhead OmniScript tutorial:
Since OmniScript code executes on the client side, browser developer tools become essential for debugging. This section covers OmniStudio-specific JavaScript techniques to extract the complete page payload.
Use these JavaScript commands in the browser console to extract the entire OmniScript data payload, as demonstrated in Rohitkumar Asare's debugging guide:
// Get all OmniScript step elements on the page
// For Standard Runtime (omnistudio namespace):
document.querySelectorAll('runtime_omnistudio-omniscript-step')
// For Vlocity/Managed Package Runtime:
document.querySelectorAll('vlocity_cmt-omniscript-step')
// Get the first OmniScript step and access its JSON data:
let osStep = document.querySelector('runtime_omnistudio-omniscript-step');
console.log(osStep.jsonData);
// Pretty print the entire JSON payload:
JSON.stringify(osStep.jsonData, null, 2)
// Step 1: Open DevTools (F12) > Elements tab
// Step 2: Use element selector and find omniscript-step element
// Step 3: Right-click > "Store as global variable" (creates temp1)
// Step 4: Access the JSON data in Console:
temp1.jsonData
// Step 5: Get formatted JSON output:
JSON.stringify(temp1.jsonData, null, 2)
// Step 6: Copy to clipboard:
copy(JSON.stringify(temp1.jsonData, null, 2))
temp1.jsonData to access the complete OmniScript JSON payload.
// If you have a custom LWC in the OmniScript, access via:
this.omniJsonData // Returns the parsed JSON object
this.omniJsonDataStr // Returns JSON as string
// Example in connectedCallback:
connectedCallback() {
console.log('Full OmniScript Data:', this.omniJsonData);
console.log('Specific field:', this.omniJsonData.Step1.FieldName);
}
// Push data back to OmniScript:
this.omniUpdateDataJson({ myField: 'newValue' });
// Apply response from external call:
this.omniApplyCallResp({ responseData: myData });
Monitor network requests to debug Integration Procedures, Remote Actions, and Data Raptors:
1. Open DevTools (F12) > Network tab
2. Clear existing requests before triggering the action
3. Trigger the OmniScript action (button click, step navigation)
4. Filter by "Fetch/XHR" to see API calls
5. Look for ApexAction requests containing:
"aura?r=XXX&aura.ApexAction.execute=1"
6. Click the request > Payload tab > Form Data
7. Find "message" field containing the JSON payload
8. Copy and use a JSON formatter to decode
aura?r=XX&aura.ApexAction.execute=1 request,
then select the Payload tab. Under Form Data, locate the message field
which contains the complete JSON payload with namespace, classname, method, and params sent to Integration Procedures or Remote Actions.
Available methods when extending OmniScriptBaseMixin in custom LWC components, documented at Salesforce Ben:
| Method/Property | Description | Usage |
|---|---|---|
omniJsonData |
Get OmniScript JSON as object | this.omniJsonData |
omniJsonDataStr |
Get OmniScript JSON as string | this.omniJsonDataStr |
omniUpdateDataJson() |
Update data in OmniScript JSON | this.omniUpdateDataJson({key: value}) |
omniApplyCallResp() |
Push external response to OmniScript | this.omniApplyCallResp(responseObj) |
omniNextStep() |
Navigate to next step | this.omniNextStep() |
omniPrevStep() |
Navigate to previous step | this.omniPrevStep() |
temp1.jsonData in Console. This works in any environment including production.
Several Chrome extensions have been developed to streamline OmniStudio debugging, making it easier to inspect requests, identify components, and analyze data flow. These are available in the Chrome Web Store.
1,000 users 5.0 (4 reviews)
Captures and logs network requests made by OmniStudio components.
196 users No ratings yet
One-click access to OmniStudio components and in-page identification.
3,000 users 5.0 (1 review)
Identify OmniStudio components on Salesforce or Experience Cloud pages.
449 users 5.0 (3 reviews)
Compare and search across OmniStudio components and orgs.
Integration Procedures (IPs) have their own dedicated debugging tools within OmniStudio, allowing you to test and troubleshoot data flow between components as covered in the Trailhead Integration Procedures module.
The Preview tab in the Integration Procedure designer provides comprehensive testing capabilities:
The Errors/Debug Output panel helps identify issues with each element, as described in Perficient's Integration Procedures guide:
The Debug Log includes two entries for each element:
NAME - Shows the OUTPUT of the element
NAMEDebug - Shows the INPUT for the step
Example:
AccountExtract - Output data from DataRaptor
AccountExtractDebug - Input parameters sent to DataRaptor
If you don't see expected outputs, review the debug entry
to find what's wrong with the input data.
The Response Action in an Integration Procedure serves multiple debugging functions:
When OmniScripts call Remote Actions or Apex classes, standard Salesforce debug logs become essential for troubleshooting server-side logic.
Configure trace flags to capture debug logs for specific users or processes:
1. Go to Setup > Debug Logs
2. Click "New Trace Flag"
3. Select Traced Entity Type:
- User: Monitor specific user's activity
- Apex Class: Log events for specific Apex class
- Apex Trigger: Log events for specific trigger
- Automated Process: For platform events and async processes
4. Set Debug Level (determines logging granularity)
5. Set Start Date and Expiration Date
6. Click Save
| Level | Description | Use Case |
|---|---|---|
| FINEST | Most detailed information | Deep debugging of complex issues |
| DEBUG | General debugging information | Standard troubleshooting |
| INFO | Operational messages | Monitoring execution flow |
| WARN | Warnings needing attention | Identifying potential issues |
| ERROR | Errors causing operation failure | Critical issue identification |
When creating Apex classes for OmniStudio Remote Actions, implement the proper Callable interface:
global with sharing class MyOmniScriptAction implements Callable {
// Required method for Callable interface
public Object call(String action, Map<String, Object> args) {
Map<String, Object> input = (Map<String, Object>)args.get('input');
Map<String, Object> output = (Map<String, Object>)args.get('output');
Map<String, Object> options = (Map<String, Object>)args.get('options');
// Add debug statements
System.debug('Input: ' + JSON.serialize(input));
return invokeMethod(action, input, output, options);
}
public Boolean invokeMethod(String methodName, Map<String, Object> input,
Map<String, Object> output, Map<String, Object> options) {
if (methodName == 'myAction') {
// Your logic here
System.debug('Executing myAction');
output.put('result', 'Success');
return true;
}
return false;
}
}
One of the most useful debugging techniques is creating a simple Apex class that receives OmniScript input parameters and prints them exactly as received. This helps you understand the exact data structure being passed from OmniScript:
global with sharing class OmniScriptDebugHelper implements Callable {
/**
* Debug helper class that prints all OmniScript input parameters
* to the debug log exactly as received. Use this in Remote Actions
* to see the complete data payload from OmniScript.
*/
public Object call(String action, Map<String, Object> args) {
Map<String, Object> input = (Map<String, Object>)args.get('input');
Map<String, Object> output = (Map<String, Object>)args.get('output');
Map<String, Object> options = (Map<String, Object>)args.get('options');
return invokeMethod(action, input, output, options);
}
public Boolean invokeMethod(String methodName, Map<String, Object> input,
Map<String, Object> output, Map<String, Object> options) {
// Print the complete input JSON exactly as received
System.debug('========== OMNISCRIPT DEBUG START ==========');
System.debug('Method Name: ' + methodName);
System.debug('----------------------------------------');
System.debug('COMPLETE INPUT JSON:');
System.debug(JSON.serializePretty(input));
System.debug('----------------------------------------');
System.debug('OPTIONS:');
System.debug(JSON.serializePretty(options));
System.debug('========== OMNISCRIPT DEBUG END ==========');
// Return the input back to OmniScript for verification
output.put('debugInput', input);
output.put('debugMethod', methodName);
output.put('debugTimestamp', System.now());
return true;
}
}
When extending OmniScript with custom Lightning Web Components, specific debugging techniques apply to ensure your components work correctly within the OmniScript context.
Custom LWCs for OmniScript must extend OmniScriptBaseMixin instead of LightningElement:
import { OmniScriptBaseMixin } from 'omnistudio/omniscriptBaseMixin';
export default class MyCustomComponent extends OmniScriptBaseMixin {
connectedCallback() {
super.connectedCallback();
// Access OmniScript data JSON
console.log('OmniScript Data:', this.omniJsonDataStr);
// Parse the JSON data
const omniData = JSON.parse(this.omniJsonDataStr);
console.log('Parsed Data:', omniData);
}
renderedCallback() {
// Debug after render
console.log('Component rendered');
}
handleClick() {
// Update OmniScript data
this.omniUpdateDataJson({
myField: 'newValue'
});
console.log('Data updated');
}
}
If console.log statements aren't appearing, check these common causes:
| Issue | Cause | Solution |
|---|---|---|
| Logs not appearing | Console filter set incorrectly | Set console to "All levels" or "Verbose" |
| Constructor logs missing | Component not fully initialized | Use connectedCallback() or renderedCallback() instead |
| No logs at all | Component not rendered on page | Verify component is added to Lightning page/app |
| Conditional render issues | Render conditions not met | Check visibility conditions are satisfied |
debugger; statement to pause execution and inspect variables directly in browser DevTools. This is often more effective than multiple console.log statements.
Follow these best practices to make OmniScript debugging more efficient and effective.
Break complex OmniScripts into smaller, modular components for easier debugging as recommended by Apex Hours.
Implement comprehensive error handling to catch and surface issues early per Cloud Foundation's guide.
Verify dependencies before building complex OmniScripts as noted in Perficient's comprehensive guide.
Maintain clean, testable Apex code for Remote Actions.
| Step | Tool/Method | Purpose |
|---|---|---|
| 1 | Data JSON Panel | Verify data structure and values |
| 2 | Action Debugger | Check request/response for actions |
| 3 | Browser Console | Look for JavaScript errors |
| 4 | Network Tab | Inspect API calls and responses |
| 5 | IP Debug Log | Review Integration Procedure steps |
| 6 | Salesforce Debug Logs | Debug Apex/Remote Actions |
| 7 | Chrome Extensions | Automated request logging |
temp1.jsonData combined with the OmniStudio Network Logger extension (Section 3) for comprehensive visibility without needing Designer access.
| Issue | Likely Cause | Solution |
|---|---|---|
| Preview works but runtime fails | Missing dependencies in target org | Run smoke tests on all components |
| FlexCard not displaying data | Empty Data Node field or wrong RecordId | Check Data Node configuration and Test Data Source |
| Integration Procedure response empty | Missing Response Action | Add Response Action to IP |
| APEX CPU limit exceeded | Inefficient DataRaptor or complex logic | Review DataRaptor config, use Action Debugger |
| Chainable IP not working | Chainable option not enabled | Enable "Chainable" in Remote Properties |
| # | Method | Type | Best For | Environment |
|---|---|---|---|---|
| 1 | Data JSON Panel | Built-in | Real-time data structure validation | Designer Preview |
| 2 | Action Debugger | Built-in | Action request/response inspection | Designer Preview |
| 3 | Browser Console (jsonData) | Browser | Runtime JSON access via temp1.jsonData | All environments |
| 4 | Network Tab | Browser | API calls, payload inspection | All environments |
| 5 | OmniStudio Network Logger | Extension | Automated request capture | All environments |
| 6 | OmniStudio Helper | Extension | Component identification | All environments |
| 7 | IP Debug Log | Built-in | Integration Procedure step debugging | Designer Preview |
| 8 | Apex Debug Helper Class | Apex | Print all OmniScript params to logs | All environments |
| 9 | Salesforce Debug Logs | Apex | Server-side Apex debugging | All environments |
| 10 | LWC Lifecycle Hooks | Browser | Custom component debugging | All environments |