Use PDF Exporter to print content of table

Hey @AlanT and @PatrickMast! The comment by @rferland above (this one) gives context for the solutions here. You can do this by creating a standalone transformer that looks something like:

const source = {{ table3.data }} // <--- this is where you'd pass your table data!

const isNumber = (value) => typeof value === 'number' && isFinite(value)
const convertToMarkdown = (data) => {
  const headers = [Object.keys(data[0])];
  const breaks = [headers[0].map((fieldName) => isNumber(data[0][fieldName]) ? "--:" : "---")];
  const rows = data.map((r) => Object.values(r));
  const tableEntries = headers.concat(breaks).concat(rows);
  return tableEntries.map((row) => "|" + row.join("|") + "|").join("\n");
}

return convertToMarkdown(source);

Then, your PDF content would be:

[...]
Table:
{{ transformer1.value }}

So in this case, tableEntries and fieldName are both variables that are being declared in the function itself so they can be left as is! The only thing that needs to change is {{ table3.data }} and you would just change that to {{ whateverYourTableNameIs.data }} :sweat_smile:

Let me know if that works!