Tables: Convert data table to text

Use this action to combine column data with text and fields for each row in a data table.

screen readers look here
Convert each row of a table into a custom format, like an address block or URL.

💡   Tip: If you want to add a table into the body of an email, use the Tables: Convert data table to markdown text action instead.

Use case

  • Create an address block from a row of address data
  • Convert and reformat a comma separated list
  • Convert data table data into unique formats required by different systems.
  • Create dynamic URLs by converting fields into URL domain and subdomains.

How to configure this action

This action converts data tables into formatted text using a row template. Using a combination of column references, text, and {{fields}}, you create a template in the row template field to convert the data table into.

The action will go through each row in a data table and convert each row to the new row template and add the row delimiter after each row. With this action, you could convert a table to CSV, or convert to a custom format for other uses.

For example, the table below contains addresses that would be helpful to convert into an address block:

First Name Last Name Street Address City State Postal Code Country
Alice Cata 555 W Washington Blvd Chicago IL 60607 USA
Bob Lytic 555 N Jefferson Blvd Naperville IL 60540 USA

More ways to use this action

Convert a data table into an address block

To convert the data table to an address block, the row template and row delimiter must be set.

  1. The row template field is where you define the new format. In this example, it’s laid out like a typical address block. The columns from the data table are referenced by their headers, such as ‘First Name’ and ‘City’.

     columns['First Name'] columns['Last Name']
     columns['Street Address']
     columns['City'], columns['State'], columns['Postal Code']
     columns['Country']
    
  2. To keep things organized, we set the row delimiter to \n\n, which will add two blank lines after each row.

  3. The action will go row by row and populate each value into the correct spot in the template. Here is an example of the output, two address blocks (one for each row), with each row separated by two new lines.

     Alice Cata
     555 W Washington Blvd
     Chicago, IL, 60607
     USA
    
    
     Bob Lytic
     555 N Jefferson Blvd,
     Naperville, IL, 60540
     USA
    
Convert a data table into a comma separated list

Another example is to convert a data table into a comma separated list, or CSV. Here is an example of how to convert the first and last name columns into to a CSV using the example data table above.

  1. To create a CSV, the row template will be the first and last name with a space in between.

     columns['First Name'] columns['Last Name']
    
  2. The row delimiter is then defined. For a CSV, , is entered into the field so a , will be added between each row.

  3. The output is the first and last name from the first row, a comma, then the first and last name from the second row. Here’s how the output would look:

    Alice Cata,Bob Lytic

  4. To give a few more examples,

    • If the delimiter was ; instead or ., the output would be: Alice Cata;Bob Lytic
    • If the row template was Full name: columns['First Name'] columns['Last Name'], the output would be Full name: Alice Cata;Full name: Bob Lytic
Convert column values for use in a multiple choice field

To dynamically create a list of options for use in a Choose one or Choose multiple field, first convert a data table column into a list of values each separated by a new line, then reference that field in the Choose one or Choose multiple field.

  1. To convert a column into a list of values separated by a new line, set the Row template to the column or columns you want to convert into a choice.
    • Use any combination of columns, texts, or fields to create each value. Keep the values on a single line.
    • For example, if the row template is columns[1], each row in the first column will be a choice.
  2. Set the Row delimiter to \n to add a new line between each value.
  • Each value must be on it’s own line, and the end result will look like this:

    value 1
    value 2
    value 3
    

Fields for this action

  • Data table

    • Select a table from a list of all tables available on your team. The list only includes tables you have permission to view.
      • You can also reference a table stored in a field. Change the left hand drop-down to Use table via field then select from any field that is part of the process. Learn more.
      • If necessary, you can enter the Table ID directly. Change the left hand drop-down to Use table by ID then enter the ID manually. Learn more.
  • Row template

    • Use a combination of columns, text, and {{fields}}. Columns can be referenced by their name columns['Column Name'] or order columns[1], with 1 being the first column. For example:

      columns['First Name'] columns['Last Name']
      columns['Street Address']
      columns['City'], columns['State'], columns['Postal Code']
      columns['Country']
      
    • See the How to configure this action section for a more detailed explanation of the row template.

  • Row delimiter

    • Choose the text or characters to separate each formatted row. For example ; or Account name: or 07/09/2019. No delimiter will be inserted after the last row.
    • In addition to basic characters, special delimiters can also be added using the following syntax:
      • Use \n or leave blank to insert a new line/line break.
      • Use \t to insert a tab.
      • Use \s to insert a space.
  • Output field name

    • Enter a name for the field in which the result should be saved

What will this output?

This action will output a data table converted into the row template format. The name of the output field will be the Output field name defined during configuration. The action output has a row limit.

Output fields for this action

  • Output field name

    • A text field where the converted text is output.

Sorry about that. What was the most unhelpful part?









Thanks for your feedback

We update the Help Center daily, so expect changes soon.

Link Copied

Paste this URL anywhere to link straight to the section.

Need more help?

If you're signed in to Catalytic Community, you can ask other users a question. You'll be redirected to Community where you can add more info.