Transform by Mesa

Mesa Transforms converts the payload sent from the previous step into a form that the next step expects. Most of the time, a Transform connector will automatically be created for you when you select an Action or add a new step based on what that step is expecting. Of the three different types of Transforms, the Mapping Transform is the most common. If you need fine-tuned logic, you can customize the script for every Transform.

Mapping Transform

The Mapping Transform is by far the most common type of transform. The Key column represents the payload key that the next step will receive. The Value column represents the the value that the key will have. The value can be a hard-coded string (like VIP or 20.99), or a liquid-style token ({{source.order_name}}) that will be replaced by the corresponding value from the payload during execution. When you click on the Token {+} icon, an autocomplete will appear with suggested tokens based on the previous and next steps in the Automation.

Transform also supports array fields, through using square parentheses. For example, to get the name of each line item on a Shopify order, you can use the token {{source.line_items[].title}} . For the destination, ensure an array field is also specified, for example {{lineItems[].title}}.

If the value is "true" or "false", it will be set to the boolean value true or false. If the value is "null", it will be set to null.

From the example above, from our Add Infinite Options Line Items to Google Sheet template, the Mapping Transform maps order data to the columns expected by the Google Sheets: Add Row to Sheet step.

Editor Transform

The Editor Transform lets you create a JSON, HTML, or text payload. It supports liquid-style tokens like  {{source.order_name}}.

Script Transform

The Script Transform allows fine-tuned logic in a JavaScript script. Enter a human-readable description of what the script is doing, and then click Edit Code to start writing your JavaScript.  Read our Technical Documentation for more details about writing scripts.