SOQL Query with parent field having null values in JSON Path

I’m calling a SOQL query trying to get a parent field with the r. notation. The problem I’m facing is that the parent field is null for some entries. So when I use the JSON path node together with the ungroup node; the values shift incorrectly. For the appropriate column, the ungroup node only sees 3 entries instead of 3 entries with the three extra null value entries.

So my question is has anyone else had a similar type of issue and if so how where you able to fix it.

Below is how it should be (extract from using the same query with salesforce inspect):

However below is the output I get with the nodes implement:
image

The workflow structure is as below;
image

Hi @Sajith,

Instead of parsing all paths in a single JSON Path, try to extract top level items like before but parents as JSON items and then in the second JSON Path, parse them and extract children.
If you provide a sample json, I’ll send you an example workflow.

1 Like

Hi @armingrudd, tried to get a simplified JSON sample. See below

{
“totalSize” : 6,
“done” : true,
“records” : [ {
“attributes” : {
“type” : “Order__c”
},
“Name” : “W76”,
“Id” : “RNaEAM”,
“Member__r” : null,
“Status__c” : “Open”
},
{
“attributes” : {
“type” : " Order__c "
},
“Name” : “W18”,
“Id” : “LXcKEAW”,
“Member__r” : {
“attributes” : {
“type” : “Members__c”
},
“Name” : “Hugh Quinn”
},
“Status__c” : “Assigned”
} ]
}

Thanks for the help, really appreciate it

40504.knwf (19.9 KB)

So the second “name” attribute is under “member_r” attribute. As I did in the shared workflow, you need to extract the whole “member_r” part as json and then parse it in another JSON Path.

3 Likes

Thank you so much @armingrudd, that solved the problem quite nicely thanks.
image

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.