How to access JObject to fetch a value

How can I get value “Exam” from below JObject?
JObject(1)
{
JProperty(1)
{
[Exam]
}
}

Awaiting your quick response.

https://forum.uipath.com/t/jsonobject-to-get-key-values-or-cannot-parse-json-string-received-from-response-uipath-improvement/24992

By following the above link, I was able to resolve the issue. It is strange but true when I was using “item” as a variable name in For Each, it did not work and I was searching for the last hour or so. However, when I used jobject as mentioned in the above post, it worked.

@loginerror, @Palaniyappan any guess why so?

1 Like

Hi @mrkrunaldoshi

Are you talking about a For Each scenario? Because you can select the type of your variable to loop over here:
image

The item variable of the loop is of type Object by default, but you can specify its type in that TypeArgument property :slight_smile:

A common scenario is to change it to String, so that you don’t have to type item.ToString all the time.

1 Like

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