Return Empty Object while convert Outsystems2JSON

Hi,

I want the following output while return the Json output.

{

"Status": "Error",

"Message": "Invalid",

"Data": {}

}


Please suggest me how to create structure for my above output.

Hi Balamurugan,

I think the problem is that without a definition of what the "Data" object should look like, Service Studio can't generate a structure for it.

Regards,
Nordin

Nordin Ahdi wrote:

Hi Balamurugan,

I think the problem is that without a definition of what the "Data" object should look like, Service Studio can't generate a structure for it.

Regards,
Nordin

Thanks Nordin Ahdi. Yes, I also tried to create the structure for this syntax. Is there any way to get the above output.


Hi Balamurugan,


First you create a Structure with three attributes and then use Json Deserialize and assign Data Type to JsonOutput structure which you created. It will returns the expected output. Also you can take a below screenshot for reference. 


-Hitesh-

Hitesh Maran wrote:

Hi Balamurugan,


First you create a Structure with three attributes and then use Json Deserialize and assign Data Type to JsonOutput structure which you created. It will returns the expected output. Also you can take a below screenshot for reference. 


-Hitesh-

Thanks Hitesh. I want to return the empty object in Data property. I am exposing this output in REST method.


Solution

Hi All,

Thanks a lot for your replies.

The issue resolved. I tried the following solution.

I have created the Data as Text Record. 

Solution