We are using an Omniscript to allow users to enter all their record data and then save it all at the end. We need to allow them to enter all the records without nesting the child record input blocks in the parent record blocks because Omniscript will not allow Type Ahead Blocks in nested blocks, and they are required for our project. So we end up with JSON for parent and children data, but they are not ordered correctly because we need to enter all the parent records and then all the children:
Parent 111
Parent 222
Parent 333
Child 1 {parentnumber = Parent 111}
Child 2 {parentnumber = Parent 111}
Child 3 {parentnumber = Parent 222}
Child 4 {parentnumber = Parent 222}
Child 5 {parentnumber = Parent 333}
The children records are tied to the parent by a “ParentNumber” Omniscript variable, but since the parents are not created yet we don’t have the parentIDs. The user selects the ParentNumber from a dropdown list created from the parentnumber array variable.
What is the best way, using Omni Studio, to get these records “posted” to Salesforce with the children properly linked to their parents?
Hey @Wendy Farzan
this is a common challenge when working with Omniscript and non-nested data entry, especially when Type Ahead blocks are involved. Since you're collecting all parent records first and then children—using a custom "ParentNumber" field to link them—the best way to handle this in OmniStudio is to use an Integration Procedure. First, post all parent records using a loop block, and store each created ParentId along with its associated ParentNumber in a temporary mapping structure. Once you have this mapping, loop through the child records and replace the ParentNumber reference with the actual Salesforce ParentId using a DataRaptor Transform or a Set Values element. Finally, post the updated child records with the correct ParentId relationships. This approach ensures that all relationships are correctly established while keeping the data entry experience clean and user-friendly. Let me know if you'd like an example setup—I’d be happy to assist.
parentNumber is some sort of external key like P-0001