My bot generates json object from that I want my bot to extract specific value. How can I do this?
Thanks in advance
My bot generates json object from that I want my bot to extract specific value. How can I do this?
Thanks in advance
you can use .SelectToken()
ex: strName = yourJObjectVar.SelectToken(“name”).ToString
It would be easy to answer if you share sample json object with details like which values you want to extract!
taking an example
jsonString = "{""name"": ""John Doe"", ""age"": 30, ""address"": {""street"": ""123 Main St"", ""city"": ""Anytown"", ""zip"": ""12345""}}"
jsonString
jsonObject
name = jsonObject("name").ToString
For nested values, ```
street = jsonObject(“address”)(“street”).ToString
use this : yourJObjectVar.SelectToken(“access_token”).ToString
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.