Help

Passing output.markdown to automations

Topic Labels: API
Solved
Jump to Solution
2763 5
cancel
Showing results for 
Search instead for 
Did you mean: 
Mariusz_S
7 - App Architect
7 - App Architect

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?

1 Solution

Accepted Solutions
Kamille_Parks
16 - Uranus
16 - Uranus

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})

See Solution in Thread

5 Replies 5
Kamille_Parks
16 - Uranus
16 - Uranus

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})

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}`)
Mariusz_S
7 - App Architect
7 - App Architect

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?

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.

Mariusz_S
7 - App Architect
7 - App Architect

Thank you @kuovonne
I’ll try to build something around Integromat, hoping this will be possible one day in a Scripting action.