How to get specific value from json object

My bot generates json object from that I want my bot to extract specific value. How can I do this?

Thanks in advance

Hi @Steven_ds_55

you can use .SelectToken()
ex: strName = yourJObjectVar.SelectToken(“name”).ToString

@Steven_ds_55,

It would be easy to answer if you share sample json object with details like which values you want to extract!

taking an example

  1. Assign Activity:
  • jsonString = "{""name"": ""John Doe"", ""age"": 30, ""address"": {""street"": ""123 Main St"", ""city"": ""Anytown"", ""zip"": ""12345""}}"
  1. Deserialize JSON Activity using UiPath Activity:
  • Input: jsonString
  • Output: jsonObject
  1. Assign Activity:
  • name = jsonObject("name").ToString

For nested values, ```
street = jsonObject(“address”)(“street”).ToString


Here I want to extract access token

@Steven_ds_55

use this : yourJObjectVar.SelectToken(“access_token”).ToString

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