Hi i am hinting an api and below is the reponse i am getting
{
"encrypted": "none",
"partner": "salesforce",
}
],
"status":
“version”: “1.1”,`
`"form
}
how can get batch id from this
Hi i am hinting an api and below is the reponse i am getting
{
"encrypted": "none",
"partner": "salesforce",
}
],
"status":
“version”: “1.1”,`
`"form
}
how can get batch id from this
Hi
check this out Deserialize JSON in UiPath | UiPath in 5 minutes | Ep:3
Hi @manoj_verma1,
First you need to use a Deserialize Json activity(https://docs.uipath.com/activities/docs/deserialize-json), where the input is your json as string.
There you will define an output variable, let’s say jsonObject.
Then, you can access the batchId property like this:
jsonObject("batchId").toString
If this solves your problem, kindly mark this post as solution.
Thanks!
Here you can check a similar post, if you need: How to quickly get the value from a json
Hi
Let’s take like you have a string variable named JsonString
Now use a Deserialise Json activity
and pass the above string and choose the type as Newtonsoft.Json.Linq.JObject
Then get the output as out_Json
Now use a assign activity like this to get the final output you want
Stroutput = out_Json.SelectToken(“batchId”).ToString
Hope this would help you resolve this
Cheers @manoj_verma1
Hey @manoj_verma1 !! Lets go to the solution!
First you need to make sure this string matches the correct JSON standards. Because it is a JSON.
After that directly store that string from where you’re reading so you don’t have problems with the quotes. As an example, I’ll read directly from a .txt and store it in the String variable “str_json”.
Let’s then use the “Deserialize JSON” activity, this activity converts a String, which is in String format, to a JSON of type JObject. That’s because as you want to extract the values of these fields, this way we can do it directly and without problems.
We store this Output in a variable of type JObject “jobj_result”, note its type.
Finally, we can access any field of interest only with this command <variable_jobject>(“<argument_name>”), see the example:
Hope it helps!!
getting error object reference not set to instance followed same way
getting error object reference not set to instance followed same way
whn i am using assign activity
Where are you using that assign activity? Send us screenshot of your workflow if possible. Thanks!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.