Parsing JSON that contains Children of Children

I have a Parse logic that worked perfect with a object containing one child.
Example:

Here are the Assigns that Parsed a One child JSON just fine.

well the JSON developer now added children to one of the children.

And now im getting this error

Any help would be greatly appreciated

Hi @Waterfowl_Waterfowl_hunte

Can you use deserialize json array activity
2Use the output in for each

3.Then you can assign
The values inside each item of an array

Would you have an example by chance?

You can’t convert something with children to a datatable. What are you trying to get out of this JSON?

@Waterfowl_Waterfowl_hunte

sample text

{
“page”: 2,
“per_page”: 6,
“total”: 12,
“total_pages”: 2,
“data”: [
{
“id”: 7,
“email”: “michael.lawson@reqres.in”,
“first_name”: “Michael”,
“last_name”: “Lawson”,
“avatar”: “https://reqres.in/img/faces/7-image.jpg
},
{
“id”: 8,
“email”: “lindsay.ferguson@reqres.in”,
“first_name”: “Lindsay”,
“last_name”: “Ferguson”,
“avatar”: “https://reqres.in/img/faces/8-image.jpg
},
{
“id”: 9,
“email”: “tobias.funke@reqres.in”,
“first_name”: “Tobias”,
“last_name”: “Funke”,
“avatar”: “https://reqres.in/img/faces/9-image.jpg
},
{
“id”: 10,
“email”: “byron.fields@reqres.in”,
“first_name”: “Byron”,
“last_name”: “Fields”,
“avatar”: “https://reqres.in/img/faces/10-image.jpg
},
{
“id”: 11,
“email”: “george.edwards@reqres.in”,
“first_name”: “George”,
“last_name”: “Edwards”,
“avatar”: “https://reqres.in/img/faces/11-image.jpg
},
{
“id”: 12,
“email”: “rachel.howell@reqres.in”,
“first_name”: “Rachel”,
“last_name”: “Howell”,
“avatar”: “https://reqres.in/img/faces/12-image.jpg
}
],
“support”: {
“url”: “Reqres - A hosted REST-API ready to respond to your AJAX requests”,
“text”: “To keep ReqRes free, contributions towards server costs are appreciated!”
}
}

just check once

I need all of these elements to type into SAP

The below multiple assign worked good for a JSON with one children but i cant get anything to work on the JSON with children of Children

@Waterfowl_Waterfowl_hunte

Different groups in Json object can be retrieved as below:

For each item in jsonObj.SelectToken(“results”)
and then for nested groups, use inner for each loop like For each item in jsonObj.SelectToken(“group”) or
For each item in jsonObj.SelectToken(“data”)
wherever you want to retrive values from.

Inside for each loop, fetch values.

or you can see this

Again, you can’t deserialize something multiple levels deep into a datatable. Datatables are two dimensional - columns and rows.

As you’re looping through the main objects in the array, you’ll have to then deserialize the child objects to get to their properties. Within all this, you use Add Data Row to add what you want to the datatable.

Thank you to all so far. I feel im getting close. Im having a hard time understanding the naming convention of the assigns in the for each. in the below UI path file you can see my data table. its a simple two column table. Here is what i have so far. If you run it, it will pull in the actual JSON that im using.

can you please give some guidance on the naming convention to call children. im not understanding it.

Main.xaml (36.8 KB)

ZIP below
API Intergration Testing - Copy.zip (10.6 KB)

JSON File if you cant get to it