Skip to main content

Hi. How can I achieve an API function that will return full JSON. 

Now I get the oData value property, but its content is not in JSON and in the external component there is no way to transform it to proper JSON. 

{
"@odata.context": "https://dev.esm.app.br/indicium/sf/esm_dev/$metadata#ESM.subroutineScalarResult",
"value": ":{\"org_id\":2,\"org_name\":\"LEF\"},{\"org_id\":10,\"org_name\":\"Servicedesk\"},{\"org_id\":11,\"org_name\":\"Sistemas\"},{\"org_id\":13,\"org_name\":\"Contratação\"},{\"org_id\":16,\"org_name\":\"Change Manager\"}]"
}

 

Hi Freddy,

Is it an option to expose a table-valued function with as API instead of a scalar function? A returned text value of a scalar function can be anything, Indicium does not recognise it to be json and simply escapes the value to be used in the json response.

If i'm not mistaken the a returned table of a table-valued function exposed as an API renders as proper json.


Hi Freddy,

Is it an option to expose a table-valued function with as API instead of a scalar function? A returned text value of a scalar function can be anything, Indicium does not recognise it to be json and simply escapes the value to be used in the json response.

If i'm not mistaken the a returned table of a table-valued function exposed as an API renders as proper json.

Yes the TVF works differently..  in this case I altered an existing view with the missing info.. instead of a function, I can ofcourse also use the $filter function of oData to get the set I want.