Log the JSON input provided for Steps in OmniStudio #788
Labels
Layer: Logger Engine
Items related to the core logging engine
Logging Source: OmniStudio
Items related to using Nebula Logger within OmniStudio
Salesforce Feature: Callable Interface
Items related to dynamically using Nebula Logger via the Apex's Callable interface
Salesforce Feature: OmniStudio
Items related to using Nebula Logger within OmniStudio
Type: Enhancement
New feature or request
Milestone
As a proof of Concept I created an OmniScript with two “steps,” Step1 and Step2, With each having two Text fields, Text1, Text2, Text3, and Text4.
When I run the script in preview mode it produces the following JSON:
{
"timeStamp":"2024-10-22T20:32:52.303Z",
"userProfile":"System Administrator",
"userTimeZoneName":"America/Chicago",
"userTimeZone":"-300",
"userCurrencyCode":"USD",
@.@.>,
"userId":"005f2000008cC7bAAE",
"omniProcessId":"0jNUQ0000000FNF2A2",
"localTimeZoneName":"America/Chicago",
"Step1":{
"Text1":"Value1",
"Text2":"Value2"
},
"isSuccess":true,
"Step2":{
"Text3":"Value 3",
"Text4":"Value 4"}
}
In between the Steps and after the steps I created a RemoteAction as described in Wiki with the following in the extrapayload section which corresponds to the parameters for the CallableLogger class:
"extraPayload": {
"loggingLevel": "FINEST",
"message": "Intermediate",
"saveLog": true
},
When it successfully creates the Log and the log entry it does any excellent job but it does not pass the JSON value from the Script to the Log.
I started looking at passing the JSON through the message parameter but that seems to be limited to a static string value. My last attempt was to put one of the values for the OmniScript metadate into the message parameter but just sent the actual string text.
In the WIKI for the newEntry Method you have these paramaetrs that might be able to do what I have in mind but not sure how that would work:
recordId
Optional
Id
When provided, Nebula Logger automatically ties the log entry to the specified SObject record ID.
Cannot be used at the same time as record, recordList, or recordMap
record
Optional
SObject
When provided, Nebula Logger automatically ties the log entry to the specified SObject record, and stores a JSON copy of the provided SObject record.
Cannot be used at the same time as recordId, recordList, or recordMap
recordList
Optional
List
When provided, Nebula Logger automatically stores a JSON copy of the provided list of SObject records.
Cannot be used at the same time as recordId, record, or recordMap
recordMap
Optional
Map
When provided, Nebula Logger automatically stores a JSON copy of the provided map of SObject records.
Cannot be used at the same time as recordId, record, or recordList
Ken Banks
Maranatha Baptist University
Director of Information Technology -- IT
o. 2421 745 West Main Street
c. 206-641-5768 Watertown, WI 53094
mbu.eduhttp://mbu.edu/ @.@.>
From: Jonathan Gillespie @.>
Sent: Tuesday, October 22, 2024 2:52 PM
To: jongpie/NebulaLogger @.>
Cc: Ken Banks @.>; Mention @.>
Subject: Re: [jongpie/NebulaLogger] Using NebulaLogger with OmniStudio -- passing the script JSON to the Log? (Discussion #785)
Hi @aBerean2https://github.com/aBerean2 any chance you could provide some screenshots/examples of the JSON that you're referring to? There's definitely a chance that I might need to add an extra argument, but I'll need to test out what you're referring to in a scratch org to see.
—
Reply to this email directly, view it on GitHub#785 (comment), or unsubscribehttps://github.com/notifications/unsubscribe-auth/BMK2IHABOFR5QA36EY2EKM3Z42UE5AVCNFSM6AAAAABQNGVEEKVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCMBSGE2DGMQ.
You are receiving this because you were mentioned.Message ID: @.@.>>
Originally posted by @aBerean2 in #785 (comment)
The text was updated successfully, but these errors were encountered: