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
  • 0
    Certified Lead Developer
    in reply to andrew23co

    Will the sub-dictionaries ("Andrew", "Anna") always have the same names, or will those be completely random?  Will these sub-CDTs always have the same fields as each other / as in your example?

    The only thing I can really think of is that you could try modifying the JSON string on the local side, in order to remove the sub-CDT parent names, which would mean you end up with an array of the same type of dictionary (presumably) after a!fromJson is run - matching the following data structure basically:

    {
      {
        "name": "Anna W",
        "age": 23
      },
      {
        "name": "Andres G",
        "age": 32
      }
    }

Children