Feb 15, 2021 01:56 PM
Hi all,
Is there a way I could pass markdown - result of script run to automations?
Like in the example here
where the output table could be send in an email?
Solved! Go to Solution.
Feb 15, 2021 05:07 PM
The Send Email action already supports markdown. Transfer whatever data you want from the Run a Script step to the Email step using output.set()
.
I.e. output.set('markdown',
## ${table.name})
Feb 15, 2021 05:07 PM
The Send Email action already supports markdown. Transfer whatever data you want from the Run a Script step to the Email step using output.set()
.
I.e. output.set('markdown',
## ${table.name})
Feb 15, 2021 09:08 PM
The example that @Kamille_Parks listed isn’t displaying correctly because this forum uses markdown-ish symbols that have different meaning in JavaScript, and it looks like the symbol clash made her example unclear. I think this is what was meant:
output.set('markdown', `## ${table.name}`)
Feb 16, 2021 05:16 AM
Makes sense. Thank you.
In the example above how would I replace the
output.table(
records.map(record => ({
Name: record.getCellValue('Name'),
Category: record.getCellValue('Category'),
'Project lead': record.getCellValue('Project lead'),
Client: record.getCellValue('Client'),
})),
);
to be able to pass the table to automations?
Feb 16, 2021 06:55 AM
The send email action has limited markdown support. I believe that the flavor of markdown in automated emails matches the markdown for rich text fields, and tables are not included.
In the custom report that you link to, the Scripting app is actually using output.table()
to produce the table, not markdown, and output.table()
is not available in a Scripting action.
If you need an actual table, you will need to build HTML and use a third party service for delivery (likely in combination with Zapier or Integromat).
If this is for internal use only and you do not need pretty formatting, you can use text formatting hacks to try and get the data to be somewhat readable or at least copy/paste-able.
Feb 16, 2021 07:24 AM
Thank you @kuovonne
I’ll try to build something around Integromat, hoping this will be possible one day in a Scripting action.