I have a query that pulls changes from an audit table. I want to put this change summary into the body of an email and send it with the update notification.
Transformer Code:
> function transformQuery7Results() {
> const queryResults = {{ query7.dataArray }};
> const gridHtml = queryResults.map(result => {
> return `
> <tr>
> <td>${result.Field}</td>
> <td>${result.OldValue}</td>
> <td>${result.NewValue}</td>
> </tr>
> `;
> }).join('');
>
> const htmlTable = `
> <table>
> <tr>
> <th>Field.value</th>
> <th>OldValue.value</th>
> <th>NewValue.value</th>
> </tr>
> ${gridHtml}
> </table>
> `;
> return htmlTable;
> }
return transformQuery7Results();
It "kind of" works, but it does not format the data as a table with rows from the array.
It takes the values from each array group and puts it in the table under the header together.
Any assistance would be appreciated.