Convert JsonToken or JsonValue to Variant

Hi,

I'm having a problem with assigning value from JsonToken or JsonValue to Variant variable.

I didn't find in documentation how can I check if value from token is certain type, and to assing that value to Variant
if JToken.IsInteger() then
    variant := JToken.AsValue().AsInteger();

Thanks

Answers

  • PhoguePhogue Member Posts: 76
    edited 2019-12-30
    If you can use the Jsontokens AsObject method to convert it into a JsonObject, you can use the
    GetValueFromJObect(JsonObject, var Variant)
    
    method from the JSON Management codeunit
Sign In or Register to comment.