Please help accessing the JSON file after parsing

Good afternoon everybody,

I am hitting the wall when deserializing the JSON file and want to use a For each loop to get the specific data out of it. The data is an array of objects but I can’t access them as I have curly brackets before them. I attached a screenshot for references and can attach my workflow if needed.

P.S. I am able to access the array of the objects if I manually remove the curly brackets at the beginning and at the end of the JSON file.

I’m not sure if I understand your problem correctly but I’ll try to answer it.
Even if the curly brackets were at the beginning, you should have no problem deserializing the JSON string.
In your provided image for example, to access the “first_name” data, you can use:
yourJSONObject(“results”)(0)(“first_name”)

Here is a sample workflow and a json file:
Main.xaml (4.6 KB)
test.json (868 Bytes)

Thank you very much Jamesty. After debugging I found out that the file can not be deserialized. The output error screenshot is attached below.

321

You have to use Deserialize JSON activity instead of Deserialize JSON Array activity since your JSON string is not an array.
That should fix it.

Thank you very much it helped. Now I have NullRefrenceException. What mught be the issue?

111

The error is being caused by a null object (or variable).
Try checking if your variables are set properly.
You might’ve forgotten to set an output variable for your deserialize JSON activity. (Just my speculation)

Thank you, I did partially resolved this issue. But might be taking the different approach as I need to extract text and write it into the Excel sheet.

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