> For the complete documentation index, see [llms.txt](https://docs.getmesa.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.getmesa.com/tools/transform.md).

# Transform

The **Transform** tool converts the payload sent from the previous step into a form that the next step expects. Of the three different types of Transforms, the Transform Mapping is the most common. If you need fine-tuned logic, you can customize the script for every Transform.

## Transform Mapping

The Transform Mapping 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 text (like `VIP` or `20.99`), or a [variable](/workflow-builder/fields/variables.md) that will be replaced by the corresponding value from the payload during execution.

When you click on the [Variables](/workflow-builder/fields/variables.md) icon \[<>] next to the value, a menu will appear with suggested variables (e.g. [Loop variables](https://github.com/shoppad/mesa-docs-gitbook/blob/master/tools/broken-reference/README.md)) based on the previous and next steps in the workflow. [It supports liquid-style variables](/workflow-builder/fields/liquid-templating.md) like `{{source.order_name}}`

In the example below, the Transform Mapping maps order data to the columns expected by the Google Sheets Write Sheet step.

<figure><img src="https://3425906282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1H6u1HQc3Iew7ATmmiCi%2Fuploads%2FKt5fegh20Icws2VFIq9b%2FCreate%20Automations%20in%20Shoppad%20Platform%20-%20Step%202%20(1).png?alt=media&amp;token=7cfbe52c-0c2d-49d4-a43f-17bbad61ae17" alt="Screenshot of a MESA Transform Mapping mapping order data to the columns expected by the Google Sheets Write Sheet step, showing the Key and Value columns. Spotlight the Key and Value mapping columns."><figcaption></figcaption></figure>

## Transform Editor

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

<figure><img src="https://3425906282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1H6u1HQc3Iew7ATmmiCi%2Fuploads%2FNXwymekGs9urKY6LgZOr%2FDW-transform-transform-editor.png?alt=media&amp;token=c9091c72-00a6-47a1-9778-65f8e1f04d84" alt="Screenshot of the MESA Transform Editor creating a JSON, HTML, or text payload with liquid-style variables. Spotlight the Editor payload input area."><figcaption></figcaption></figure>

## Transform Script

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: [Scripts](https://docs.getmesa.com/for-developers/admin-api#scripts) and [Script Specification](https://docs.getmesa.com/tools/custom-code/script-specification).

<figure><img src="https://3425906282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1H6u1HQc3Iew7ATmmiCi%2Fuploads%2FhfTUUVEZcz7xJmOI4oj0%2FDW-transform-transform-script.png?alt=media&amp;token=a1d5896d-482a-4a16-aa39-dcf2bb06be41" alt="Screenshot of the MESA Transform Script with a human-readable description of what the script does. Spotlight the Edit Code button."><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.getmesa.com/tools/transform.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
