I do not understand how I could iterate on Object

Hello !
I’ve readed some topics but I do not understand how I could iterate on a JObject. I’m using a deserialize JSON to create JObject.

This is my response from HTTP Request
“{"Result":[{"Order":0,"RelatedTable":"CookingModes","Name":" Sans cuisson"},{"Order":1,"RelatedTable":"CookingModes","Name":"Bouilli"},{"Order":2,"RelatedTable":"CookingModes","Name":"Cru"},{"Order":3,"RelatedTable":"CookingModes","Name":"Cuit"},{"Order":4,"RelatedTable":"CookingModes","Name":"Etuvée"},{"Order":5,"RelatedTable":"CookingModes","Name":"Frits"},…”

My objective is to add each propery into a data table. I do not understand how I could reach each property into my for each. And I do not understand why I can’t change the type of argument into for each.
Thanks for any help !

For each activity | item in myJObject("Result").Values(of JObject)

myJObject is the output from Deserialize JSON

1 Like

@Florent_Delage
After deserialize json

Use deserialize json array activity after that use for each for it output

Inside for each use add datarow

A flat oneliner would look like this:

Assign acitvity:
dtResult = myJObject("Result").ToObject(Of Datatable)

1 Like

Thank you, it’s working at last, only a problem of using the correct syntax for cast… Pfffiu ! Two hours on this issue. Thanks !

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