Skip to content

Markdown Notes

Markdown is a lightweight markup language with plain-text formatting. See: Markdown Guide

You can use Markdown in ThinkAutomation for outgoing email text, Teams Messages, Web Forms, Web Chat and Wait For User Response forms (headings, prompt text, help text). You can also use it with the Set Variable action. The Set Variable action has an option for converting Markdown to HTML and for converting CSV data to a Markdown table.

For example: If you set an outgoing plain text email or Teams message to:

# Order Received
Please find below your order:

Order: **1234**
Link: [View Order](https://mycompany.com/orders/1234.pdf)

The outgoing email HTML would convert to:

<h1 id="order-received">Order Received</h1>
<p>Please find below your order:</p>
<p>Order: <strong>1234</strong><br />
Link: <a href="https://mycompany.com/orders/1234.pdf" target="_blank">View Order</a></p>

For outgoing emails any converted HTML will be wrapped inside <html> & <body> tags. A basic CSS stylesheet will be applied. The CSS can be edited in the Server Settings - Default CSS.

Any of the standard Markdown formatting can be used. See: https://www.markdownguide.org/basic-syntax

Tables

For tables you can use Pipe format or Grid format.

Pipe Format

| abc | def | ghi |
|:---:|-----|----:|
|  1  | 2   | 3   |

Would convert to:

<table>
<thead>
<tr>
    <th style="text-align: center;">abc</th>
    <th>def</th>
    <th style="text-align: right;">ghi</th>
</tr>
</thead>
<tbody>
<tr>
    <td style="text-align: center;">1</td>
    <td>2</td>
    <td style="text-align: right;">3</td>
</tr>
</tbody>
</table>

Or..

# Details

| Item    | Details           |
| ------- | ----------------- |
| From    | **%Msg_From%**    |
| To      | **%Msg_To%**      |
| Subject | **%Msg_Subject%** |

Would convert to:

<h1>Details</h1>
<table>
<thead>
<tr>
    <th>Item</th>
    <th>Details</th>
</tr>
</thead>
<tbody>
<tr>
    <td>From</td>
    <td><strong>sender@test.com</strong></td>
</tr>
<tr>
    <td>To</td>
    <td>receiver@test.com</td>
</tr>
<tr>
    <td>Subject</td>
    <td><strong>Test Subject</strong></td>
</tr>
</tbody>
</table>

Note

Pipe style tables must have a blank line before and after the table.

Grid Format

A grid table allows you to have multiple lines per cells and cells can span over multiple columns. For example:

+---------------+---------------+--------------------+
| Fruit         | Price         | Advantages         |
+===============+===============+====================+
| Bananas       | $1.34         | - built-in wrapper |
|               |               | - bright color     |
+---------------+---------------+--------------------+
| Oranges       | $2.10         | - cures scurvy     |
|               |               | - tasty            |
+---------------+---------------+--------------------+

Alignments can be specified as with pipe tables, by putting colons at the boundaries of the separator line:

+--------------:+:--------------+:------------------:+
| Right         | Left          | Centered           |
+==============:+:==============+:==================:+
| Bananas       | $1.34         | built-in wrapper   |
+---------------+---------------+--------------------+

For headerless tables:

+--------------:+:--------------+:------------------:+
| Right         | Left          | Centered           |
+---------------+---------------+--------------------+

Note

For grid format, when using multiple lines per cell the column separators must line up.

Converting CSV Data To A Markdown Table

If you have CSV data you can use the Set Variable or Text Operation actions to convert CSV data to a Markdown table. Numeric columns will be right aligned and date columns will be center aligned.

Any URL will automatically be converted to a link. You can also use the syntax:

[Link Text](http://www.mysite.com)

Would convert to:

<a href="http:/www.mysite.com" target="_blank">Link Text</a>

For images you can use the syntax:

![Logo](http://www.mysite.com/assets/images/logo.png)

Would convert to:

<img src="http://www.mysite.com/assets/images/logo.png" alt="Logo">

Markdown document files or attachments (*.md) can be converted to PDF, Word & HTML files using the Convert Document action.

Returning Markdown

You can use use the automation Return action to return Markdown text. If the message source is an API, Web Form or Web Chat then the Markdown will be automatically converted to HTML (unless the HTTP accept request header is text/plain - in which case the Markdown is returned un-converted).

For manually executed automations sent by users of the Desktop Connector or Studio (via the Send Message form) then any Markdown content in the Return value will be rendered.