Hi @v-litu-msft
Sure and thank you again for the help! Below is a copy of the JSON, I have anonimised and removed some parts which aren't relevant to keep it short.
The JSON contains 3 "cases" (root level) from Dynamics, some of which have notes (Incident_Annotation) and emails (Incident_Emails) in the respective nested arrays which is what I want to add to my HTML table. So based on the JSON example here is what I want to do in the HTML table is as below:
| Logged | Reference | Notes | Emails |
10/09/2020 13:47 (createdon@OData.Community.Display.V6.FormattedValue) | CAS-06055-Q0B6F9 (ticketnumber) | a test note about something This is a note text again (Incident_Annotation - notetext from all) | test email about something another test email about something (Incident_Emails - description from all) |
(createdon@OData.Community.Display.V6.FormattedValue) | (ticketnumber) | | |
(createdon@OData.Community.Display.V6.FormattedValue) | (ticketnumber) | (Incident_Annotation - notetext from all) | |
[
{
"@odata.type": "#Microsoft.Dynamics.CRM.incident",
"@odata.id": "https://demodata.crmdemo.dynamics.com/api/data/v9.6/incidents(d976ea6b-6cf9-ea66-a967-000d9a7fcd6e)",
"@odata.etag": "W/\"9977905\"",
"@odata.editLink": "incidents(d976ea6b-6cf9-ea66-a967-000d9a7fcd6e)",
"description": "This is test case 1 which has notes (Incident_Annotation) and emails (Incident_Emails)",
"statecode@OData.Community.Display.V6.FormattedValue": "Active",
"statecode": 0,
"caseorigincode@OData.Community.Display.V6.FormattedValue": "Email",
"caseorigincode": 5,
"title": "This is test case",
"prioritycode@OData.Community.Display.V6.FormattedValue": "Normal",
"prioritycode": 5,
"ticketnumber": "CAS-06055-Q0B6F9",
"createdon@OData.Community.Display.V6.FormattedValue": "10/09/2020 13:47",
"createdon@odata.type": "#DateTimeOffset",
"createdon": "2020-09-10T13:47:04Z",
"incidentid@odata.type": "#Guid",
"incidentid": "d976ea6b-6cf9-ea66-a967-000d9a7fcd6e",
"primarycontactid": {
"@odata.type": "#Microsoft.Dynamics.CRM.contact",
"@odata.id": "https://demodata.crmdemo.dynamics.com/api/data/v9.6/contacts(ddd6b4ae-77f9-ea66-a967-000d9a7fcd6e)",
"@odata.editLink": "contacts(ddd6b4ae-77f9-ea66-a967-000d9a7fcd6e)",
"fullname": "Test contact",
"contactid@odata.type": "#Guid",
"contactid": "ddd6b4ae-77f9-ea66-a967-000d9a7fcd6e"
},
"Incident_Emails": [
{
"@odata.type": "#Microsoft.Dynamics.CRM.email",
"@odata.id": "https://demodata.crmdemo.dynamics.com/api/data/v9.6/emails(6d67edaa-66f9-ea66-a967-000d9a7f5595)",
"@odata.etag": "W/\"9949576\"",
"@odata.editLink": "emails(6d67edaa-66f9-ea66-a967-000d9a7f5595)",
"createdon@OData.Community.Display.V6.FormattedValue": "10/09/2020 13:08",
"createdon@odata.type": "#DateTimeOffset",
"createdon": "2020-09-10T13:08:07Z",
"description": "test email about something"
},
{
"@odata.type": "#Microsoft.Dynamics.CRM.email",
"@odata.id": "https://demodata.crmdemo.dynamics.com/api/data/v9.6/emails(a6dc595d-09f4-ea66-a967-000d9a7f5595)",
"@odata.etag": "W/\"9949575\"",
"@odata.editLink": "emails(a6dc595d-09f4-ea66-a967-000d9a7f5595)",
"createdon@OData.Community.Display.V6.FormattedValue": "11/09/2020 08:31",
"createdon@odata.type": "#DateTimeOffset",
"createdon": "2020-09-11T08:31:25Z",
"description": "another test email about something"
}
],
"Incident_Annotation@odata.type": "#Collection(Microsoft.Dynamics.CRM.annotation)",
"Incident_Annotation": [
{
"@odata.type": "#Microsoft.Dynamics.CRM.annotation",
"@odata.id": "https://demodata.crmdemo.dynamics.com/api/data/v9.6/annotations(54604cbf-efba-69cb-997d-bc0adb9f6e09)",
"@odata.etag": "W/\"9977544\"",
"@odata.editLink": "annotations(54604cbf-efba-69cb-997d-bc0adb9f6e09)",
"createdon@OData.Community.Display.V6.FormattedValue": "12/09/2020 11:54",
"createdon@odata.type": "#DateTimeOffset",
"createdon": "2020-09-12T11:54:56Z",
"notetext": "a test note about something"
},
{
"@odata.type": "#Microsoft.Dynamics.CRM.annotation",
"@odata.id": "https://demodata.crmdemo.dynamics.com/api/data/v9.6/annotations(ec69059b-9d90-cb96-9960-cf697469ff6b)",
"@odata.etag": "W/\"9949596\"",
"@odata.editLink": "annotations(ec69059b-9d90-cb96-9960-cf697469ff6b)",
"createdon@OData.Community.Display.V6.FormattedValue": "12/09/2020 11:49",
"createdon@odata.type": "#DateTimeOffset",
"createdon": "2020-09-12T11:49:12Z",
"notetext": "This is a note text again"
}
],
"subjectid": {
"@odata.type": "#Microsoft.Dynamics.CRM.subject",
"@odata.id": "https://demodata.crmdemo.dynamics.com/api/data/v9.6/subjects(4a49aa94-cef6-ea66-a967-000d9a7fcd6e)",
"@odata.editLink": "subjects(4a49aa94-cef6-ea66-a967-000d9a7fcd6e)",
"title": "a subject",
"subjectid@odata.type": "#Guid",
"subjectid": "4a49aa94-cef6-ea66-a967-000d9a7fcd6e"
}
},
{
"@odata.type": "#Microsoft.Dynamics.CRM.incident",
"@odata.id": "https://demodata.crmdemo.dynamics.com/api/data/v9.6/incidents(006ef5b7-e0f4-ea66-a967-000d9a7fcd6e)",
"@odata.etag": "W/\"9949066\"",
"@odata.editLink": "incidents(006ef5b7-e0f4-ea66-a967-000d9a7fcd6e)",
"statecode@OData.Community.Display.V6.FormattedValue": "Active",
"statecode": 0,
"title": "This is test case 2 which has NO notes (Incident_Annotation) and NO emails (Incident_Emails)",
"prioritycode@OData.Community.Display.V6.FormattedValue": "Normal",
"prioritycode": 5,
"ticketnumber": "CAS-06059-R5Z6Y0",
"createdon@OData.Community.Display.V6.FormattedValue": "10/09/2020 11:32",
"createdon@odata.type": "#DateTimeOffset",
"createdon": "2020-09-10T11:32:55Z",
"incidentid@odata.type": "#Guid",
"incidentid": "006ef5b7-e0f4-ea66-a967-000d9a7fcd6e",
"Incident_Emails": [],
"Incident_Annotation": []
},
{
"@odata.type": "#Microsoft.Dynamics.CRM.incident",
"@odata.id": "https://demodata.crmdemo.dynamics.com/api/data/v9.6/incidents(e776cdbe-76f6-ea66-a967-000d9a7fcd6e)",
"@odata.etag": "W/\"4697474\"",
"@odata.editLink": "incidents(e776cdbe-76f6-ea66-a967-000d9a7fcd6e)",
"description": "Dynamics",
"statecode@OData.Community.Display.V6.FormattedValue": "Active",
"statecode": 0,
"title": "This is test case 3 which has notes (Incident_Annotation) and NO emails (Incident_Emails)",
"prioritycode@OData.Community.Display.V6.FormattedValue": "Normal",
"prioritycode": 5,
"ticketnumber": "CAS-06054-Y9P0R0",
"createdon@OData.Community.Display.V6.FormattedValue": "10/09/2020 11:41",
"createdon@odata.type": "#DateTimeOffset",
"createdon": "2020-09-10T11:41:17Z",
"incidentid@odata.type": "#Guid",
"incidentid": "e776cdbe-76f6-ea66-a967-000d9a7fcd6e",
"Incident_Emails": [],
"Incident_Annotation": [
{
"@odata.type": "#Microsoft.Dynamics.CRM.annotation",
"@odata.id": "https://demodata.crmdemo.dynamics.com/api/data/v9.6/annotations(cb0d9f99-a7d0-0994-99fb-97664a97c094)",
"@odata.etag": "W/\"4697469\"",
"@odata.editLink": "annotations(cb0d9f99-a7d0-0994-99fb-97664a97c094)",
"createdon@OData.Community.Display.V6.FormattedValue": "10/09/2020 11:51",
"createdon@odata.type": "#DateTimeOffset",
"createdon": "2020-09-10T11:51:37Z",
"notetext": "test notes",
"_objectid_value@Microsoft.Dynamics.CRM.associatednavigationproperty": "objectid_incident",
"_objectid_value@Microsoft.Dynamics.CRM.lookuplogicalname": "incident",
"_objectid_value@odata.type": "#Guid",
"_objectid_value": "e776cdbe-76f6-ea66-a967-000d9a7fcd6e",
"annotationid@odata.type": "#Guid",
"annotationid": "cb0d9f99-a7d0-0994-99fb-97664a97c094",
"objecttypecode@OData.Community.Display.V6.FormattedValue": "Case",
"objecttypecode": "incident"
}
]
}
]