Hi All,
Is there any way to get the json output in the following format with independent Query entity data results.
Here is the use case:
we have an application as parent object and Invoices are the child objects to that parent object.
while providing the json response through Web API with funcation toJson like
toJson( value: { application: local!aplicationObject, Invoices: local!invoiceObjexts } )
output comes like
{ “application” :{ Application related fields ----- } “invoices” [ { Invoide realted fields ---- }, { Invoice related fields ---- } ] }
Note:Invoice objects are out side the application object.
where as expected out should be like Invoice objects should be inside the application object like
{ “application” : { Application related fields ----- “invoices” [ { Invoide realted fields ---- }, { Invoice related fields ---- } ] } }
Please help us in get the above expected outcome with minimal changes.
Thanks in Advance.
Discussion posts and replies are publicly visible
ramp said:Invoice objects should be inside the application object
What makes you say this? This is not how your initial data is structured, so I'm not clear why you'd expect it to be that way in the output.
Thanks Mike for the prompt response. Invoices objects are related to Application object. so Expected response should be like Application object contains the Invoice objects as well. how to achieve this with two independent query entity rule responses like one is Application response and another is Invoice Response.
Please advise us to achieve the same as Json.