Please help to get key where “IsLatestVersion”: true
input - {
“@odata.context”: UiPath,
“@odata.count”: 2,
“value”: [
{
“Key”: “f943f755-9553-46a8-bfd768”,
“ProcessKey”: “Fedex_Retail_Claim_Process”,
“IsLatestVersion”: false,
“Name”: “Retail_Claims”
},
{
“Key”: “3e7c8a6d-872c-4edbf60d790”,
“ProcessKey”: “Fedex_Retail_Claim_Process”,
“IsLatestVersion”: true,
“Name”: “Fedex_Retail_Claim_Process”
}
]
}
Output:
3e7c8a6d-872c-4edbf60d790
You can try this approach:
- Make sure that the JSON payload is correct. You can use https://jsonformatter.org/json-pretty-print for that.
- Add the UiPath.WebAPI.Activities in your project dependencies.
- Save the payload to a txt file.
- Read the Text File.
- Deserialize JSON.
- Use a Write Line to display the IsLatestVersion.
jsonPayloadObject.SelectToken("$.value.[1].IsLatestVersion").ToString()
- Results → True
1 Like
Anil_G
(Anil Gorthi)
3
@tharani.natarajan
After deserializing json as mentioned above…please use this in assign
djson("value").Where(function(x) x("IsLatestVersion").ToString.Tolower.Contains("true")).Select(function(x) x("Key").ToString)(0)
cheers
Thanks a lot for explanation
system
(system)
Closed
5
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.