MESA Docs
MESA Homepage
  • Welcome to MESA
    • Installing MESA
    • Dashboard
    • Core Concepts
    • Getting Help
  • Templates
    • Template Library
    • Installing & Editing
  • Workflow Builder
    • Triggers
    • Actions
    • Fields
      • Variables
      • Formatting Variables
      • Liquid Templating
    • Testing
  • Workflow Activity
    • Tasks
      • Troubleshooting
      • Replay
    • Logs
    • Time Travel
  • Best Practices
    • Set Titles & Descriptions
    • Track Time Saved
    • Enable Failure Notifications
    • Avoid Infinite Loops
  • Going Further
    • Plans & Billing
    • Notifications
    • Credentials
    • Understanding the Queue
    • Export & Import Workflows
    • Platform Thresholds & Limits
  • Built-in Tools
    • Activity Log
    • AI
    • API
    • Approval
    • MCP
    • Custom Code
      • Libraries
        • MESA SDK
        • Filter
        • Loop
        • Transform
        • oAuth
        • Shopify
        • ShopifyGraphql
      • FAQ
    • Data
    • Delay
    • Email
    • Filter
    • Form
      • Configure
      • Going Further
      • Technical Notes
    • FTP
    • Image
    • Loop
    • Package Tracking
    • Paths
    • Schedule
    • Scraper
    • SMS
    • Transform
    • Virtual Output
    • Weather
    • Web Request
    • Webhook
  • Apps
    • Airtable
    • Amazon S3
    • Asana
    • Blog Studio
    • ChannelApe
    • Claude
    • ChatGPT
    • Dall-E 2
    • Delighted
    • Digital Humani
    • Discord
    • DocuSign
    • Dropbox
    • Etsy
    • Facebook
    • Fera.ai
    • Gatsby
    • Gmail
      • Send Email
    • Google Analytics 4
    • Google Analytics UA
    • Google Calendar
    • Google Drive
    • Google Forms
    • Google Sheets
      • Add Row
      • Query Rows
      • Update Row
      • Row Created
      • Row Updated (Advanced)
      • Creating New Spreadsheets
      • Technical Notes
    • Gorgias
    • Govalo
    • Help Scout
    • Hubspot
    • Infinite Options
    • Intercom
    • IPDetective
    • Judge.me
    • Katana
    • Klaviyo
      • API Deprecation
    • Loop Returns
    • Loyalty Lion
    • Mailchimp
    • Mailgun
    • Mandrill
    • Mantle
    • Notion
    • Odoo
    • Omnisend
    • Page Studio
    • Pinterest
    • Printful
    • PrintNode
    • QuickBooks
    • Rebuy
    • Recharge
    • Remove.bg
    • Returnly
    • Rivo
    • Salesforce
    • Segment
    • Sendlane
    • Shippo
    • ShipStation
    • Shopify
      • Technical Notes
        • Configuring Your Payload
        • Modifying and Filtering Get Lists
        • Parameters
        • Error Codes
        • Accuracy of orders_count Variable
        • Accuracy of Count Products Action
        • Using the Gift Cards API
        • How to Find a Specific Record in the Testing Interface
        • Order, Customer, and Product Updated Trigger Frequency
    • Shopify Flow
    • Shopify Plus
    • Shopify Retail POS
    • Skio Subscriptions
    • Slack
    • Smartrr
    • Smile.io
    • Square
      • Updating Inventory
      • Frequently Asked Questions
    • Stamped.io
    • Stripe
    • Thanks.io
    • TikTok
    • Tracktor
    • Twilio
    • Uploadery
    • Wonderment
    • Xero
    • Yotpo
    • Yotpo Loyalty
  • For developers
    • Admin API
    • Command Line Interface
    • Embedding templates
  • Frequently asked questions
    • Why isn't the log search returning logs with the search I entered?
    • Is it possible to handle errors or retry steps?
    • How do I handle a failed task?
    • Does MESA auto-save workflows?
    • Can I Use Apps That Don't Have a MESA Connector?
    • Why is my workflow action adding the same data each time it occurs?
    • How do I cancel automations that are already in progress?
    • How do I cancel my MESA subscription or 7-day trial?
    • Can you import code from npm in custom code?
    • Do you have a Slack Community?
Powered by GitBook
On this page
  • Configure
  • Populating a table
  • Viewing a table
  • Using data stored in a table
  • Going Further
  • Alter Tables
  • Column types
  • Connect to your data
  • Technical Notes

Was this helpful?

  1. Built-in Tools

Data

PreviousFAQNextDelay

Last updated 1 month ago

Was this helpful?

The Data tool lets you save and read information in a private database built into MESA.

The Data allows you to persist information between workflow runs; saving data from one workflow and accessing it in another.

Configure

You can create tables from within any Data step that allows you to create or update a row, for example, Data's "Create Record" action.

Specify a table name and begin adding columns to your table.

Choose one of our supported column types:

Type
SQL Type
When to use
Example

Text

varchar(255)

Ideal for most text strings (keys, titles, names, etc). Maximum length: 255 characters.

Jannette Parks

Long Text

text

For free-form text and JSON blobs.

Jannette Parks likes to go to the park and play on the swings, the merry-go-round, and the super-duper play structure. She's an adventurer and she likes the thrill. She would stay at the park all day long, every day in fact, if she had the chance, and play with her yeti friend, Yedric.

Integer

int8

For integers and numeric IDs. Supports numbers between -9223372036854775808 and 9223372036854775807.

13

Number

numeric

For numbers with decimal-point precision.

13.99

Date

date

For dates

2024-11-30

Date and time

timestamptz

For date and times, with timezone information.

2024-11-30 13:24:00-07

Boolean

bool

Values that are either true or false

True

It is recommended that you label your columns with no spaces included.

Columns will be in the same order as they're created here.

Three additional columns will be automatically added: mesa_id, mesa_created_at, mesa_updated_at

Click the workflow's "Save" button to save your columns to the database.

Once you save your workflow, to avoid affecting workflows that may use the same table, you can no longer delete the column or adjust your column's Name or Type from the user interface.

You can run one of the queries in the Altering Tables section below if you need to adjust your columns.

Populating a table

You can select the data to store in the column's value field.

Another option is to add your own text:

Viewing a table

Go to My account under your account name.

Then, click on the Data tab.

Select View Data to browse the data in the table or Database Options to Query or Alter the table:

Using data stored in a table

Retrieve Record action

To use stored data in a table, you can use the Retrieve Record action. This retrieves a single row. For example, you can retrieve one particular order.

Query Action

This action retrieves multiple rows. For example, you can use this step to grab all of a user's orders.

Example Queries

Only show records that contain a string

SELECT * FROM "customers" WHERE "email" ILIKE '%@getmesa.com%';

Only show records created after a certain UTC date and time, sorted newest first:

SELECT * FROM "customers" WHERE "mesa_created_at" > '2022-01-04T17:51:00.000Z' 
  ORDER BY "mesa_created_at" DESC;

Join two tables together:

SELECT * FROM "orders" 
  LEFT JOIN "customers" ON "orders"."customer_id" = "customers"."id";

Record Created or Record Updated trigger

This step starts a workflow when a new row is added to the table or a row has one of its values changed.

Going Further

Alter Tables

You can remove columns or change their type by running an ALTER query. Go to the Settings Page and click the âš™ cog icon next to the table. The query box will be pre-populated with some commented-out SQL queries to help you get started.

Remove a column

To remove a column, uncomment the first line and the DROP COLUMN line, replace {{column_name}} with your column, and click Run Query. For example:

ALTER TABLE "line_items"
  DROP COLUMN "{{column_name}}"

Change a column type

To change the column type, uncomment the first line and the ALTER COLUMN line corresponding to the column you would like to change by removing the -- at the beginning of each line. Then change the column type to one of the options in the Column types listed below:

ALTER TABLE "line_items"
  ALTER COLUMN "order_id" TYPE decimal

Note that in some cases (especially if you have existing data), changing the column may not be as easy as running the query above. In these cases, removing the column and re-adding it from the workflow builder with the new desired column type may be easier.

Delete a table

To delete a table, use the following query:

DROP TABLE "Add table name here"

You will need to change the Add table name here text to the name of your table and keep the double quotations.

Column types

Data supports the following column types:

  • Text varchar(255): Ideal for most text strings (keys, titles, names, etc). Maximum length: 255 characters.

  • Long Text text: For free-form text and JSON blobs.

  • Integer int8: For integers and numeric IDs. Supports numbers between -9223372036854775808 and 9223372036854775807.

  • Number numeric: For numbers with decimal-point precision.

  • Date date: For dates.

  • Date and time timestamptz: For date and times. Includes timezone information.

Connect to your data

Use your connection details from the Settings page to connect directly to your Data tool's database. You can use these credentials for a desktop querying client or business intelligence tool or read and write data directly from your custom application.

  • Business Intelligence Clients

  • SQL Clients

Technical Notes

Give each column a name and type by choosing one of our supported column types, and select the data to store in that column by selecting or adding static text to the column's value field.

One method is selecting through :

.

.

: an open-source BI tool for exploring, visualizing, and sharing data via a user-friendly interface, with support for both simple queries and advanced SQL

: a powerful analytics platform for creating interactive visualizations and dashboards, enabling users to explore and share data insights with ease.

: an open-source SQL editor and database manager offering a clean interface for querying, editing, and managing databases efficiently.

: a modern database management tool with a sleek interface designed to simplify querying, editing, and managing multiple databases efficiently.

Data is built on top of PostgresSQL and supports its features. .

The Record Created and Record Updated triggers utilize to detect changes.

variables
variables
More examples and information about SELECT queries
More examples and information about ALTER queries
Metabase
Tableau
Beekeeper Studio
TablePlus
Learn more about connecting to PostgreSQL databases
polling