Not able to extract id after deserialize json string of the type shown in image



id is a property of an JObject, which is value of the data property

Give a try at:
Jobj("data")("id").Value(Of String)
Or
Jobj.SelectToken($..id).ToString

For Rnd/Prototyping the JPath also have a look here:

And
https://goessner.net/articles/JsonPath/

In this the character is not allowed…

If possible share the JSON as text file with us
You can try : Jobj(“data”)(“id”).ToString
Please ensure that the Deserialize JSON activity is defining TypeArgument: JObject (e.g. when bouncing back From Web Studio to local UiPath Studio)

Untitled.json (16.2 KB)
It would be helpful if u help me with this

Kindly note: we used 2x dot (is similar to // form XPath - relative decscendant)
grafik


Any other solution @ppr ??

Lets do it one by one to eliminate some error sources

A Json like
grafik

will be displayed / visualized within the immediate panel like
grafik

but the doubled " is about visualisation and is not part of the content
grafik
" "" "" " start the string first " 4x" for the 2Double quotes end the string with " = 6x "

we can access:
grafik
We do have more relative id’s so we fail:
grafik
As we got 9 ids:
{ “id”, “orderAmount.id”, “trip.id”, “createdByUser.id”, “members[0].id”, “product.id”, “product.productInformation.id”, “product.productInformation.productAmount.id”, “supplierOrganization.id” }
grafik
And access the first by:
grafik


Kindly note:
Your provided JSON was about:
grafik

we do see that the data property value is a Serialized JSON representing a JObject

similar to
grafik

In that case we do Deserialize the JSON string again
grafik

im not getting .parse function

ensure that the following Namespaces are imported:
grafik

OR

use FullQualified Name

OR

Deserialize Jobj(“data”).toString additional with a second Deserialize JSON Activity

Thanks alot

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