Hi I am trying get "kmsUserId" in json file in loop I have try this following methods i have attached the code and json file

Hi I am trying get “kmsUserId” in json file in loop I have try this following methods i have attached the code and json file .
step 1 : I am trying To Get http request from api key
step 2 : Writing the file into txt file because the data is wast
step 3 : Reading the txt file
step 4 : Deserialize JSON and store it jsonObject
step 5 : Deserialize JSON array because the “kmsUserId” we need inside the array

at step 5 it is showing the error Deserialize JSON Array: Object reference not set to an instance of an object.
Kindly Help.
Deserialize_Json.txt (2.1 MB)
Sequence1.xaml (10.3 KB)

Hi @Rohan_Ashok_Gonabal

currentJToken("kmsUserId").ToString


Hope it helps!!

Hi @Rohan_Ashok_Gonabal

Try below Expression in Assign Activity Output Should be Array

ArrkmsUserID = jsonObject("d")("results").Select(Function(x) x("kmsUserId").ToString()).ToArray()

Hope it’ll helps you :slight_smile:
Cheers!!

A direct grab we can do:
grafik

For looping we can do:
For Each Activity | item in myJObject(“d”)(“results”).Values(Of JObject)

  • log message: item(“kmsUserId”).Value(Of String)

we do also avoid the additional JArray Parsing with above Part: …Values(Of JObject)

RnD Check:
grafik

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