JamesCarlos
3 years agoQrew Member
Pipeline Iterate over JSON nested data
I was pulling in JSON data from Ground Control and was having some trouble pulling in some nested data while creating a record. Here is how I solved it. I hope I can save some people time.
Used the method posted here to get this started: JSON Handler details
------------------------------
James Carlos
------------------------------
Used the method posted here to get this started: JSON Handler details
Data initially pulled was not an issue at the top level.
Nested inside my data is "customFieldValues".
Sample:
"customFieldValues": [
{
"name": "SomeFieldA",
"value": "Abcdefg"
},
{
"name": "SomeFieldB",
"value": "1234567"
},
{
"name": "SomeFieldC",
"value": "CwhatIDidThere?"
}
]
To pull in this value I needed to use a raw_record Jinja expression and state the location in the array.
{{b.raw_record['customFieldValues'][0]['value']}}
0 is used since this is the first location in the Array.
(This assumes that b. is the reference used for the other fields such as {{b.status}} )
This is placed in the field reference in Create Record step for SomeFieldA.
------------------------------
James Carlos
------------------------------