Skip to main content

Understand Elements and mapping

Understand how Payloads uses Elements to model API content and map runtime values into bodies, headers, parameters, modifiers, and response data.

Understand Elements and mapping

Elements are how Payloads models API content.

An Element can represent a body field, a nested object, an array item, a header, a URL parameter, or a URL modifier. The Element tells Payloads where a value belongs and where that value should come from when the Payload runs.

For the broader runtime picture, see Understand Payload data flow.

What an Element controls

Every Element answers three practical questions.

  • Where is this value used?

  • What is the value called or where is it located?

  • How should Payloads get the runtime value?

For body Elements, the location is usually a path such as $.line_items.price_data.unit_amount. For headers and parameters, the location is the header or parameter name. For modifiers, the location is the token in the endpoint URL that should be replaced.

A Stripe checkout request body showing nested Elements for mode, customer, line items, success URL, and cancel URL.

The Element tree mirrors the structure Payloads will build when it sends the request.

Structure and source are separate

The Element structure describes the shape of the content. The Element source describes the value.

That separation is important. A request body can keep the same structure while different Elements use different sources:

  • Static Value for fixed values such as payment

  • Field for values read by a Data Query, such as Opportunity.Amount

  • Dynamic Input for values supplied when the Payload runs

  • Credential for values stored on the selected Credential

  • Transformation when a value needs to be adjusted before use

In the Stripe checkout example, line_items is an Array Element backed by the queried OpportunityLineItems child records. line_items.price_data.unit_amount is part of the request structure, but the runtime value comes from the current OpportunityLineItem's Unit Price. Payloads shows that directly in the Body table, so users can review the API field and its Salesforce source from the same screen.

The Payload Body table showing Stripe checkout Elements mapped from static values and Opportunity query fields.

The Body table shows the mapping source beside each Element, including child-record fields such as OpportunityLineItem Unit Price.

Parent and child Elements

Nested API content is built from parent and child Elements.

The root Element usually represents $. Payloads creates the root as an Object by default because most API bodies start as an object. If the external API expects a top-level array, change the root Element to Array and build the rest of the structure underneath it.

Child Elements under the root become top-level fields. Elements under another Element become nested fields.

Array Elements create repeated structure. A line_items Array can repeat once for every record returned by a Data Query or child relationship. Fields inside that Array can use the current array record as their source, while fields outside the Array use single-record values from the wider Payload context.

The parent-child tree is easier to maintain than hand-written JSON because each value remains visible and editable on its own row.

Request and response Elements

Outbound Elements build what Payloads sends.

Inbound Elements model what Payloads expects to receive or parse. You do not need to model every field in an API response or inbound request. Model the values your integration uses for field mappings, response output, transformations, troubleshooting, or later Payload runs.

A Stripe checkout response body showing the fields Payloads needs from the API response.

The response model only includes fields the integration needs to read or store.

Dynamic Inputs in Elements

Use Dynamic Inputs when the value is not fixed on the Payload and should be supplied when the Payload runs.

In the fulfilment update demo, the Stripe session id is a Dynamic Input. The same Payload can be reused for different sessions because the session id is passed in at runtime.

An Outbound Webhook Payload body showing a Dynamic Input mapped into the request body.

Dynamic Inputs keep runtime values visible without hard-coding them into the Payload.

What to check

Before testing an Element mapping, check that:

  • the path or header name matches the external API documentation

  • the direction is correct for the Payload section you are editing

  • the placement is correct: Body, Header, Parameter, or Modifier

  • the source matches where the runtime value should come from

  • field mappings point to the correct Data Query

  • Dynamic Input names match the values passed by Flow, Apex, or another runtime caller

  • transformations are used only where the value actually needs to change

After testing, open the Job and compare the configured Elements with the outbound or inbound data that was captured.

Did this answer your question?