Mapping

Pass data from a previous step—or from the current session—into any step field that supports it.

Mapping lets you reference a value from an earlier step and use it as input in a later one. For example, you can take an email address collected in a form and pass it directly into a notification or an outbound webhook—without writing any code.

📘

Not all step fields support mapping. Check the individual step documentation to see which fields accept mapping placeholders.

Step references

To reference a field from a previous step, use the Handlebars-style syntax with the step name and field name in backticks.

{
  "value": "{{`Previous Step Name`.`Field To Map`}}"
}

Let's look at a concrete example. In a two-step project with a Form followed by a Notification, you can pull the submitter's first name from the form into the notification message.

{
  "message": "{{`Onboarding Form`.`first-name-field`}} just submitted the onboarding form."
}

A few things to note:

  • The step name must match the description field of the step you're referencing.
  • The field name must match the id of the component within that step.
  • Mapping placeholders are resolved at runtime when the session runs.

Session metadata

In addition to referencing previous steps, you can reference information about the running session itself. These fields are always available regardless of the step order.

nameplaceholderdescription
Session ID{{Session metadata.__session_id}}Unique id for the current session
Session start date{{Session metadata.__session_start_date}}Session start timestamp (ISO 8601)
User ID{{Session metadata.__user_id}}Id of the user who started the session (empty for anonymous sessions)
Project ID{{Session metadata.__project_id}}Id of the project the workflow belongs to

Let's look at how session metadata fields are used in an Outbound Webhook step. The example below sends the session id to an external endpoint.

{
  "request": {
    "method": "POST",
    "url": "https://api.example.com/events",
    "authentication": { "type": "NONE", "connectionId": null },
    "body": {
      "requestMode": "RAW",
      "contentType": "JSON",
      "content": {
        "sessionId": "{{`Session metadata`.`__session_id`}}"
      }
    }
  }
}

You can include as many session metadata fields as you need. Here's the same webhook with all four fields in the payload.

{
  "request": {
    "method": "POST",
    "url": "https://api.example.com/events",
    "authentication": { "type": "NONE", "connectionId": null },
    "body": {
      "requestMode": "RAW",
      "contentType": "JSON",
      "content": {
        "sessionId": "{{`Session metadata`.`__session_id`}}",
        "sessionStartDate": "{{`Session metadata`.`__session_start_date`}}",
        "initiatedBy": "{{`Session metadata`.`__user_id`}}",
        "projectId": "{{`Session metadata`.`__project_id`}}"
      }
    }
  }
}