I have written a azure function which will return data into json string format but i want data into json object so that i can directly use that array output for next step into logic app.
azure function code -
composeMessage = "{\"__metadata\": {\"id\": "+obj.id+",\"uri\": "+obj.uri+",\"dateForSystem\": "+obj.dateForSystem + ",\"timeForSystem\": "+obj.timeForSystem + "}";
composeMessageList.Add(composeMessage);
outputDerivedTableKey = string.Empty;
startIndex = 0;
}
var jsonToReturn = JsonConvert.SerializeObject(composeMessageList);
return new HttpResponseMessage(HttpStatusCode.OK) {
Content = new StringContent(jsonToReturn, Encoding.UTF8, "application/json")
getting output like -
[
"{\"__metadata\": {\"id\": ,\"uri\": ,\"type\": },\"dateForSystem\": 2019-05-17,\"timeForSystem\": 13:15:51}",
"{\"__metadata\": {\"id\": ,\"uri\": ,\"type\": },\"dateForSystem\": 2019-05-17,\"timeForSystem\": 13:15:51}",
"{\"__metadata\": {\"id\": ,\"uri\": ,\"type\": },\"dateForSystem\": 2019-05-17,\"timeForSystem\": 13:15:51}",
]
But I can't pass this array to foreach in logic app i'm excepting output format like below from azure function -
[
{
"__metadata": {
"id": "",
"uri": "",
"type": ""
},
"dateForSystem": "2019-05-17",
"timeForSystem": "13:15:51"
},
{
"__metadata": {
"id": "",
"uri": "",
"type": ""
},
"dateForSystem": "2019-05-17",
"timeForSystem": "13:15:51"
},
{
"__metadata": {
"id": "",
"uri": "",
"type": ""
},
"dateForSystem": "2019-05-17",
"timeForSystem": "13:15:51"
},
]
How can i achieve this format output from azure function ?
Or how to format this into logic app?