Scenario
This guide covers two fundamental use cases:- Form Mode: Copy a value from a single source (header, body field, query parameter) to another variable.
- Template Mode: Combine values from multiple sources to create a single variable.
Example 1: Copy a Value with Form Mode
In this example, theX-Tenant-Id header value is copied to a custom variable. If the header is missing, default-tenant is assigned as the default value.
Row Configuration
Result
Example 2: Copy a Body Field
AuserId field from the request body is read in Form mode and stored in a custom variable.
Row Configuration
Example 3: Merge Multiple Sources with Template Mode
In this example, a username from the request header, an operation type from the body, and the system date-time are combined to create a single audit entry variable.Template
Row Configuration
Result
For a sample request (X-User-Name: john, body {"operationType":"update"}):
Example 4: Building a Composite Identifier
Combining two fields from the request body and context information to create a unique transaction ID:Template
Result
For the full list of variable sources, see the template syntax section on the Message Builder policy page.

