Hello,


I am trying to generate JSON of my Form that structurally should look like this

[

    {

        "CustomerRequest": {

            "Id": 107,

            ... ,

            "ContactPerson": {

                "Id": 30,

                ...

            }

        }

    }

]

However upon generating the JSON data from OutSystems, we got this instead

[

    {

        "ContactPerson": {

            "Id": 30,

            ...

        },

        "CustomerRequest": {

            "Id": 107,

            ... 

        }

    }

]


Can somebody give a quick rundown on how the structure became like the second one instead of the first one?


Best Regards,


Yosua

Hi Yosua,

Why does it matter in what order the JSON is formed? There is no programmatic reason to have this in specific sorting. 

As for your question. What do you use as base? An aggregate or a Structure? With a structure you can set the order of the different properties and I believe this is also reflected in the JSON itself.

Greetings,

Vincent

Solution

Hi Yosua,


On the first JSON, "ContactPerson" is part of "ContactRequest". You want them side by side, so you can do something like on the screenshot below:



Cheers,

João

Solution

I totally missed the fact that ContactPerson was indented and thus part of CustomerRequest :(

Hello guys,


Thank you for the answers. Appreciate them!



Yosua