44
Views
1
Comments
JSON Listify Multiple Paths | ardoJSON

Hi, is there a way to listify multiple dynamic list paths at once using ardoJSON? I have tried writing path expression but it doesn't work. Do I need to do a for loop to listify all paths? Example of the JSON data is as below, I want to listify all entities paths. 

{

  "entity1": {

    "0": {

      "attribute1": "value",

      "attribute2": "value",

      "attribute3": "value"

    },

    "1": {

      "attribute1": "value",

      "attribute2": "value",

      "attribute3": "value"

    }

  },

  "entity2": {

    "0": {

      "attribute4": "value",

      "attribute5": "value",

      "attribute6": "value"

    },

    "1": {

      "attribute4": "value",

      "attribute5": "value",

      "attribute6": "value"

    }

  }

}


You can try to build the list you want here:
https://jnb.outsystemscloud.com/ardoJSONReactiveDemo/JSON_Listify

If you want to reach the inner structures, you can write, for example, "entity1.0" to listify the "0" structure.
The result would be this:

{

    "entity1": {

        "0": [

           {

                "key": "attribute1",

                "value": "value"

            },

           {

                "key": "attribute2",

                "value": "value"

            },

           {

                "key": "attribute3",

                "value": "value"

            }

        ],

        "1": {

            "attribute1": "value",

            "attribute2": "value",

            "attribute3": "value"

        }

    },

    "entity2": {

        "0": {

            "attribute4": "value",

            "attribute5": "value",

            "attribute6": "value"

        },

        "1": {

            "attribute4": "value",

            "attribute5": "value",

            "attribute6": "value"

        }

    }

}


Hope it helps.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.