- Introduction
- Getting started
- Build on any canvas
- Build with Case
- Reference
- Defining case keys (system vs. external)
- Establishing task I/O and write-back contracts
- Modeling primary and secondary stages
- Triggering a case from Data Fabric
- Implementing stage-level personas and permissions
- Setting SLAs and automated escalation rules
- Configuring a rework loop (re-entry)
- Configuring and testing the Case Manager Agent (preview)
- Build with Flow
- Build with BPMN
- Operating
- Monitoring
- Optimizing
- Reference information
Transform
Apply several operations to a list in one node: filter it, reshape each item, group the items, or run your own JavaScript.
Transform applies a chain of operations to a list in one node. Each operation receives the result of the one before it, so you can, for example, keep only the open orders, reshape each one, then group them by customer. It's in the Data category of the Add node panel.
Set up the node
-
Select + on the handle of the node it follows, then select Data > Transform.
-
In the properties panel, select Edit transformation.
-
In Collection, enter the list to transform, for example
$vars.scriptTask1.output. The field expects an array. -
Add the operations, in the order they should run:
Operation What it does Add Filter Returns only the items that match the conditions you set. Add Map Turns each item into a new shape, with the field mappings you define. Add Group By Groups the items by a field, and computes a count, sum, or average for each group. Add Custom Script Runs your own transformation logic in JavaScript. -
Select Run to test the node, and check the result in the Output column.
Output
The node returns the result of the last operation as output. Later nodes read it as $vars.<nodeId>.output, for example $vars.transform1.output.
Transform or Script
Use Transform when the work is filtering, reshaping, or grouping a list. Use Script when the logic doesn't fit these operations. Within Transform, Add Custom Script covers a single step that needs code.
Common issues
| Issue | Resolution |
|---|---|
| Collection shows an error | The field is required, and it expects an array. Check the value in the execution trace of the node that produces it. |
| The output is empty after a filter | The conditions don't match any items. Check the field names and values of the input in the execution trace. |
The output has undefined fields after a map | The source field doesn't exist in the input items. Check the input structure in the execution trace. |
Next steps
- Filter, Map, and Group by: one operation per node.
- Variables and data flow: how
$varsreferences work.