Rest API JSON requests with 'dynamic tag names'

When working with the Microsoft Graph API a number of the methods take a request like the below.  Does anyone have an guidance on how to build a structure to make this work as you need to be able to dynamically put a value in the String value.

{  "String-value":  

                        {    "alias": "String",    

                              "lastModifiedBy": "String",    

                              "lastModifiedDateTime": "String(timestamp)",    

                              "previewPriority": "String",    

                              "type": "String"  

                        }

}

Paul Davies wrote:

When working with the Microsoft Graph API a number of the methods take a request like the below.  Does anyone have an guidance on how to build a structure to make this work as you need to be able to dynamically put a value in the String value.

{  "String-value":  

                        {    "alias": "String",    

                              "lastModifiedBy": "String",    

                              "lastModifiedDateTime": "String(timestamp)",    

                              "previewPriority": "String",    

                              "type": "String"  

                        }

}

Hi paul,

Please have a look at this discussion 

https://www.outsystems.com/forums/discussion/40058/json-deserialize-error/#Post144178

and

https://www.outsystems.com/forums/discussion/28488/deserialize-a-dynamic-json-object/

This may help you.

Regards,

Seema


Paul Davies wrote:

When working with the Microsoft Graph API a number of the methods take a request like the below.  Does anyone have an guidance on how to build a structure to make this work as you need to be able to dynamically put a value in the String value.

{  "String-value":  

                        {    "alias": "String",    

                              "lastModifiedBy": "String",    

                              "lastModifiedDateTime": "String(timestamp)",    

                              "previewPriority": "String",    

                              "type": "String"  

                        }

}


Hi Paul,



Recently i was also facing the same issue,

The solution to this is you can use JSON deserialize componet.

GO through JSON deserialize doc, you will get how to use it.

Then next you have to create the structure of your JSON under Data -> Structure/ Right click on Structure-> Select add structure from JSON.

Your JSON structure will be created and the you can process the data.

For you refrence :- https://www.outsystems.com/forums/discussion/53272/json-desrialize/


Cheers