Given the JObject balances, how can I select balance where asset = ‘XBT’?
I am trying to return the value ‘2.2547’.
Thanks in advance
myJObject is the output of the deserialize JSON Activity
As the balance is a JArray we can access the element (JObject) by index:
For filtering to the corresponding JObject Item we can do:
myXBTJO | DataType: JObject =
myJObject(“balances”).Where(Function (x) x(“asset”).Value(Of String).Equals(“XBT”)).FirstOrDefault
Then evaluate if myJObject is null or not an retrieve the balance
An optimistic Approach could be:
And will return below, when item is not present
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.