HI James,
Thanks for detailed answer. With you help , I'm able to at least see JSON file properly with it's structure.
Are you able to create multiple records from your JSON file? I'm not
My assumption is with this JSON two records should be formed with my JSON below
Name | FILE
Prashant | Record 1
Prashant | Record 2
{
"file": [
"Record 1",
"Record 2"
],
"Name": "Prashant"
}
Currently only 1 record is Created with Record 1 & Record 2 together in 1 value with
1. {{b.raw_record['file']['value']}} OR
2 {{b.raw_record['file'][0]['value']}}
------------------------------
Prashant Maheshwari
------------------------------
Original Message:
Sent: 07-28-2022 14:10
From: James Carlos
Subject: Pipeline Iterate over JSON nested data
First, I use postman to confirm I am getting the data.
For the "Iterate over JSON records" step, copy a record that is returned by Postman (or other tool) and paste that in to the JSON Schema Sample. Make sure it is only one record and include the {}.
------------------------------
James Carlos
Original Message:
Sent: 07-28-2022 13:04
From: Prashant Maheshwari
Subject: Pipeline Iterate over JSON nested data
HI James,
Thanks for posting this , I was actually struggling with JSON yesterday . I had to give up .
Can you post more screenshots (specially the iteration of JSON records part) or post YAML of your pipeline (without sensitive parts)
------------------------------
Prashant Maheshwari
Original Message:
Sent: 07-28-2022 11:34
From: James Carlos
Subject: 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
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
------------------------------