Skip to main content
Solved

Passing output.markdown to automations

  • February 15, 2021
  • 5 replies
  • 39 views

Forum|alt.badge.img+13

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?

Best answer by Kamille_Parks11

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

5 replies

Kamille_Parks11
Forum|alt.badge.img+27
  • Brainy
  • 2679 replies
  • Answer
  • February 16, 2021

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


Justin_Barrett
Forum|alt.badge.img+21
  • Inspiring
  • 4647 replies
  • February 16, 2021

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

Forum|alt.badge.img+13
  • Author
  • Inspiring
  • 39 replies
  • February 16, 2021

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?


kuovonne
Forum|alt.badge.img+29
  • Brainy
  • 6009 replies
  • February 16, 2021

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.


Forum|alt.badge.img+13
  • Author
  • Inspiring
  • 39 replies
  • February 16, 2021

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