How to get values of Json Object starting with a key name unique for each data

I have a Json object I get from a web database through HTTP request like;

{
DataID1:{Column1:value,Column2:value,Column3:value},
DataID2:{Column1:value,Column2:value,Column3:value},

}
I want to get each value of “Column1” & “Column2” but each first key “DataID” part is unique numbers for each data row in the database and I don’t see one until I make access.

I figured out I can get past the first key by using PropertyValues like

For each value in jObject.PropertyValues("Column1")
messagebox : item 
#shows each value of Column1

If this is Python, I would do

For value1, value2 in zip(jObject.PropertyValues("Column1"),jObject.PropertyValues("Column2"))
print(value1 + value2)

or

print(jObject[list(jObject.keys()[0])]["Column1"]+jObject[list(jObject.keys()[0])]["Column2"])

How can I achieve this in UiPath?

This article might help on accessing a Json Array/JArray

1 Like

Thank you for sharing this but I think I know the basic of Json.
The problem is my json object doesn’t start with a consitant key like “records” in this video.
instead starts with digits unique to each data row like
eachloop1=jObject(“123”)(“Column1”)
eachloop2=jObject(“456”)(“Column1”)

So maybe I want to dictate like
For each item in jObject
Write Line
text: item(key_value_index(0))(“Column1”)

I’m Japanese and asked the same question on Japanese Forum, then Yoichi here showed me I should use “.Children” property like

jObject.Children.Children.Values
to achieve this.

And with his sample and your video I realized I should also set TypeArgument as corresponding Json type=Newtonsoft.Json.LinqJToken

I’m really grateful for all your help.

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