trying to format api json result to show comments and replies
ex.
Comment
Reply
Reply
Comment
JSON Response
"@odata.context": "https://graph.microsoft.com/v1.0",
"@odata.count": 2,
"value": [
{
"id": "16658526dafs40855",
"replyToId": null,
"etag": "1665852640855",
"messageType": "message",
"createdDateTime": "2022-10-15T16:50:40.855Z",
"lastModifiedDateTime": "2022-10-15T16:50:40.855Z",
"lastEditedDateTime": null,
"deletedDateTime": null,
"subject": null,
"summary": null,
"chatId": null,
"importance": "normal",
"locale": "en-us",
"webUrl": "Join conversation",
"policyViolation": null,
"eventDetail": null,
"from": {
"application": null,
"device": null,
"user": {
"id": "ea6be1e1-a539-415d-a991-adsf",
"displayName": "adf",
"userIdentityType": "aadUser",
"tenantId": "e6dddc4a-1c3d-4d17-99c2-adsf"
}
},
"body": {
"contentType": "text",
"content": "test 2"
},
"channelIdentity": {
"teamId": "3f59f1aa-edbd-401d-adf-af",
"channelId": "19:asdf@thread.tacv2"
},
"attachments": [],
"mentions": [],
"reactions": [],
"replies@odata.context": "https://graph.microsoft.com/v1.0/$metadata#teams('afd-edbd-401d-ae51-adsf')/channels('19�%40thread.tacv2')/messages('adf')/replies",
"replies@odata.count": 1,
"replies": [
{
"id": "1665852744750",
"replyToId": "1665852640855",
"etag": "1665852744750",
"messageType": "message",
"createdDateTime": "2022-10-15T16:52:24.75Z",
"lastModifiedDateTime": "2022-10-15T16:52:24.75Z",
"lastEditedDateTime": null,
"deletedDateTime": null,
"subject": null,
"summary": null,
"chatId": null,
"importance": "normal",
"locale": "en-us",
"webUrl": "Join conversation",
"policyViolation": null,
"eventDetail": null,
"from": {
"application": null,
"device": null,
"user": {
"id": "ea6be1e1-a539-415d-a991-2908ce548fed",
"displayName": "sfd asdf",
"userIdentityType": "aadUser",
"tenantId": "asdf-1c3daf4d17-99c2-asf"
}
},
"body": {
"contentType": "text",
"content": "test 3"
},
"channelIdentity": {
"teamId": "3f59f1aa-edbd-asfd-ae51-af",
"channelId": "19:asfd@thread.tacv2"
},
"attachments": [],
"mentions": [],
"reactions": []
}
]
},
{
"id": "1665852475049",
"replyToId": null,
"etag": "1665852475049",
"messageType": "message",
"createdDateTime": "2022-10-15T16:47:55.049Z",
"lastModifiedDateTime": "2022-10-15T16:47:55.049Z",
"lastEditedDateTime": null,
"deletedDateTime": null,
"subject": null,
"summary": null,
"chatId": null,
"importance": "normal",
"locale": "en-us",
"webUrl": "Join conversation",
"policyViolation": null,
"eventDetail": null,
"from": {
"application": null,
"device": null,
"user": {
"id": "dsf",
"displayName": "asdf",
"userIdentityType": "aadUser",
"tenantId": "e6ddasdf170"
}
},
"body": {
"contentType": "text",
"content": "test"
},
"channelIdentity": {
"teamId": "3f59f1aasdfef03fc",
"channelId": "19:2447fadsfcv2"
},
"attachments": [],
"mentions": [],
"reactions": [],
"replies@odata.context": "https://graph.microsoft.com/v1.0asdf",
"replies": []
}
]
}
JavaScript Query
var d = query1.data.value
var outArr = []
d.forEach((a) => {
outArr.push({
id: a.id,
body: a.body,
replies: [{
body: a.replies
}]
})
})
return outArr;
Listview Text
This gives me all comments but no replies
{{query2.data[i].replies[i].body[i].body.content}}
This give me the comment with the reply but nothing else
{{query2.data[i].replies[i].body[i].body.content}}
{{query2.data[i].body.content}}