adding attributes to the structure

Hi,

I am having below JSON initially

"{

"id":1,

"name":"abc"

}" 

and following structure

structure1-id,name


in the future, I will be having below JSON format

"{

"id":1,

"name":"abc",

"role":"dev"

}"


how can I add role attribute dynamically under structure1?


PS: I am consuming data from REST API


Thanks,

Ronan



Hi Rohan,


I think its not possible to add element dynamically in structure.

however you can add olumn in entity using command alter.


Thanks 

Rahul Sahu

HI  @Ronan T,


In Outsystems there are two possible ways to do this

Scenario  1 :   you can copy the response  and here as shown in the image below and click on finish , its automatically update your structure 

Scenario 2 :  GO the rest api method and test it again and click on copy response it automatically update the structure 

Currently in outsystems we have only these two solutions.


I Hope this helps you :)

Thank you

Regards,

Shree


Srinivas K Singadi wrote:

HI  @Ronan T,


In Outsystems there are two possible ways to do this

Scenario  1 :   you can copy the response  and here as shown in the image below and click on finish , its automatically update your structure 

Scenario 2 :  GO the rest api method and test it again and click on copy response it automatically update the structure 

Currently in outsystems we have only these two solutions.


I Hope this helps you :)

Thank you

Regards,

Shree


Hi Shree,

I think this is not a dynamic way, every time we have to go back to our application and redit the JSON structure



Ronan T wrote:

Srinivas K Singadi wrote:

HI  @Ronan T,


In Outsystems there are two possible ways to do this

Scenario  1 :   you can copy the response  and here as shown in the image below and click on finish , its automatically update your structure 

Scenario 2 :  GO the rest api method and test it again and click on copy response it automatically update the structure 

Currently in outsystems we have only these two solutions.


I Hope this helps you :)

Thank you

Regards,

Shree


Hi Shree,

I think this is not a dynamic way, every time we have to go back to our application and redit the JSON structure



Hi Ronan,

As mentioned above you could generate the correct structure this way, however for your use case I suggest making sure the Role attribute is non-mandatory, that way it'll accept both responses.

Kind regards,
Glenn