I'm working with an OmniScript that includes a custom LWC component. The LWC writes the following structure into the OmniScript's jsonData:
"SelectSigners": {"PickSigners": [
{
"email": "[email protected]",
"id": "005AU00000KyHnFYAV",
"name": "eu User 2",
"role": "EU_Customer_R",
"routingNumber": 1,
"recipientId": 1,
"recipientType": "Signer",
"recipientLocale": "en_US",
"Select": true,
"signerRole": 1
}]}
What I need is to change the signerRole field to 2 by default, ideally without affecting the rest of the structure.
Here’s what I’ve tried:
DataRaptor Transform
During preview, it correctly modifies signerRole to 2.
However, the OmniScript jsonData remains unchanged after execution.
Set Values element
Using SelectSigners:PickSigners[0]:signerRole as the element name and 2 as the value.
Instead of updating the existing field, it creates a new, duplicate attribute in the root of jsonData.
Integration Procedure (Remote Action Custom Apex Class)
Similar to the DataRaptor: it returns the correct value in debug, but does not update the OmniScript’s jsonData.
Question: How can I reliably update a nested field like SelectSigners.PickSigners[0].signerRole within the OmniScript jsonData without creating a duplicate or without losing reference to the original structure written by the LWC?