Skip to main content
Suresh Anbil
New Participant
Aug 29, 2023 10:02 AM UTC

JSON to U2 Dynamic Array

Any U2 Basic program utility available to import JSON object into a dynamic array or Name-Value pair? I expect the U2 program to accept a JSON object as an input, and a list of Variable names to parsed from the JSON object. The output could be a name-value pair.



------------------------------
suresh anbil
Owner
OHM Systems Inc
Cincinnati OH US
------------------------------

    13 replies

    Daniel Conradie
    Participating Frequently
    Sep 28, 2023 4:48 PM UTC

    We do this all the time with our Red Leaf web framework.  Based on that project, we have a series of API routines to extract JSON data into name-value pairs.  The problem with JSON (and XML) is that the nesting can go deeper than three levels.  So the API routines allow an X-Path kind of specifier to identify what to extract so anything can be extracted, even if it's deeper than attributes/values/subvalues.



    ------------------------------
    Kevin King
    President
    Precision Solutions, Inc.
    Longmont CO US
    ------------------------------

    Hi Kevin,

    that sounds good, could you send me samples or anything that i can look at to see if i can use it pls?



    ------------------------------
    Daniel Conradie
    Rocket Forum Shared Account
    ------------------------------
    Kevin King
    Participating Frequently
    Sep 29, 2023 11:57 AM UTC

    Hi Kevin,

    that sounds good, could you send me samples or anything that i can look at to see if i can use it pls?



    ------------------------------
    Daniel Conradie
    Rocket Forum Shared Account
    ------------------------------

    Daniel, send me your email address and I'll send you the code and docs.



    ------------------------------
    Kevin King
    President
    Precision Solutions, Inc.
    Longmont CO US
    ------------------------------
    Daniel Conradie
    Participating Frequently
    Sep 29, 2023 5:12 PM UTC

    Daniel, send me your email address and I'll send you the code and docs.



    ------------------------------
    Kevin King
    President
    Precision Solutions, Inc.
    Longmont CO US
    ------------------------------

    daniel.conradienz@gmail.com

    Thanks very much Kevin



    ------------------------------
    Daniel Conradie
    Rocket Forum Shared Account
    ------------------------------