Blocks
Transform Block
Map and reshape data between systems using declarative field mapping
The Transform block maps data from one shape to another using declarative field mapping. Use it to convert between system formats -- for example, mapping a Stripe invoice to a QuickBooks invoice structure.
Configuration
Mapping
Define field mappings as key-value pairs where keys are output field names and values are template expressions referencing input data.
{
"customerEmail": "{{input.data.object.customer_email}}",
"amount": "{{input.data.object.amount_paid}}",
"invoiceNumber": "{{input.data.object.number}}",
"paidAt": "{{input.data.object.status_transitions.paid_at}}"
}Computed Fields
Mappings support expressions for simple transformations:
{
"amountDollars": "{{input.data.object.amount_paid / 100}}",
"displayName": "{{input.data.object.customer_name || 'Unknown'}}",
"isPaid": "{{input.data.object.status === 'paid'}}"
}Outputs
| Output | Type | Description |
|---|---|---|
result | JSON | The transformed data object with all mapped fields |
When to Use Transform vs Code
| Scenario | Use |
|---|---|
| Simple field renaming | Transform |
| Nested object restructuring | Transform |
| Basic calculations | Transform |
| Loops, conditionals, aggregations | Code block |
| External API calls | Integration block or Code block |
Best Practices
- Name output fields descriptively. Use camelCase and match the target system's naming convention.
- Handle missing fields. Use the
||operator to provide fallback values:{{input.field || 'default'}}. - Keep transforms focused. One Transform block per system-to-system mapping. Do not try to handle all transformations in a single block.
Code Block
Use code for complex transformations
Agent Block
Use AI for unstructured data transformation