Hey all,
I am attempting to trigger a CSV download (using data from a table) using a custom HTML button.
I have tried the below, however it seems like I am unable to interact with anchor links or even add one that includes a blob into a custom HTML element (the anchor gets removed saying "The following unsupported elements or attributes have been removed: attribute href from element a.".
const data = getTableData()
const csv = data.map((row) => Object.values(row).join(',')).join('\n')
const blob = new Blob([csv], { type: 'text/csv' })
const url = URL.createObjectURL(blob)
LFForm.changeFieldSettings(
{ fieldId: 12 },
{ content: `<a href="${url}" download="data.csv">Download</a>` }
)
Just wondering if anyone knows of a way to accomplish this in modern designer?