JustPaid Workflows
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

OutputTypeDescription
resultJSONThe transformed data object with all mapped fields

When to Use Transform vs Code

ScenarioUse
Simple field renamingTransform
Nested object restructuringTransform
Basic calculationsTransform
Loops, conditionals, aggregationsCode block
External API callsIntegration 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.

Frequently Asked Questions

On this page