How to store this below json value in entity?

How to store this below json value in entity?

  

{

"Id"      :12345,          

"Created_DateTime":  "1943-12-31" ,  

"Created_By"      :  "santhu",

"Posting_Request" : "sfjhv" ,

"Posting_Response": "vsdjhgv",      

"PostingStatus"   :    "success" ,  

"MetaData": {

              "name"      :"santros",

              "surname"          :   "ms",

              "age":21,

              "Address":"fsdfdss",

             }


}


//how to store metadata value into a separate entity?

Hi Harshavardhan,

I'm not sure I understand exactly what you are asking. Do you receive this JSON via a REST service? If not, you must create a Structure for it (right click on "Structures", then choose "Add Structure from JSON..."). Once it's in a structure, assign the data to an Entity-type Variable (or mapping it) is really rather straightforward?

Solution

Hello

When you consume your webservice that returns this json, or convert this json to an OutSystems structure, MetaData will have to be a structure itself.

You just need to assign its value to an Entity that can receive those data, and Create a record in the entity.

From where comes this JSON?
What exactly did you try already?

Cheers.

Solution

Kilian Hekhuis wrote:

Hi Harshavardhan,

I'm not sure I understand exactly what you are asking. Do you receive this JSON via a REST service? If not, you must create a Structure for it (right click on "Structures", then choose "Add Structure from JSON..."). Once it's in a structure, assign the data to an Entity-type Variable (or mapping it) is really rather straightforward?

hi kilian, 

thanks for your reply. I receive this JSON via REST service.


Harshavardhan,

So your receive it via REST, which means you have a structure that contains the data. So what exactly is your question? How to store stuff in the database? That's all pretty basic OutSystems stuff, could you explain what you don't understand how to do?