Poblems with a dictionary with not normalized index

Hello people,

I get a JSON with this structure:

{

"Anna": {

"name" : "Anna W",
"age":  23

},

"Andrew":{

"name" : "Andres G"
"age":  32

},
.
.
n

}

I transform it in a dictionary, but a I getting problems when I try to iterate it with a foreach, anyone knows another way to do it?

  Discussion posts and replies are publicly visible

Parents Reply
  • This is the example code,

    = load(
      local!a: a!fromJson(a!toJson({
          "Anna": {
            "name": "Anna W",
            "age": 23
          },
          "Andrew": {
            "name": "Andres G",
            "age": 32
          }}
      )),
      a!forEach(
        items: local!a,
        expression: fv!item
      )
    )

    It recognise the Dictionary with a single item, I can not iterate it, I need to transform it in a regular CDT

    Resul:

    List of Dictionary: 1 item

    Dictionary

         Anna: Dictionary

           name: "Anna W"

           age: 23

        Andrew: Dictionary

           name: "Andres G"

           age: 32

Children