Chaining Transforms
A pipeline runs a list of transforms in order and hands each result to the next step. Use it to clean a value up, map it and format it in one definition. Pipelines can be nested up to 20 levels deep.
Applies to
Anywhere you can choose Transform. See Where They Are Used.
Limits
Pipelines and if branches nest up to 20 levels deep.
How values flow through a pipeline
- The first step usually names its value with
input, for example"input": "${department}". - Each later step that has no
inputworks on the previous step's result. - A step that has its own
inputuses that and ignores the previous result. - The pipeline returns the last step's result.
| Step type | Uses the previous result? |
|---|---|
uppercase, lowercase, trim, replace, split, regex, lookup, date-format, date-add | Yes, when the step has no input. |
math | Yes, as the left operand, when the step has neither left nor input. |
if | Its condition doesn't, but the chosen then or else branch receives it. |
pipeline | Yes. A nested pipeline's first step receives the outer pipeline's current value. |
concat, decision, static, uuid, current-date | No. They build their value from their own options, so the previous result is discarded. |
Building a pipeline
To chain transforms in a mapping:
- In the mapping row, choose Transform as the Source.
- After Insert:, select pipeline to start from the starter definition.
- Give the first step an
inputthat names the attribute to start from. - Add later steps without an
inputso each works on the result before it. - End with the step that produces the final form, often a
lookupwith adefault. - Save the mappings.
Example: normalise, then map
Department values arrive with stray spaces and mixed case. Trim and upper-case them before looking up the organisational unit.
{
"type": "pipeline",
"steps": [
{ "type": "trim", "input": "${department}" },
{ "type": "uppercase" },
{ "type": "lookup",
"mapping": { "IT": "OU=IT,DC=example,DC=com",
"FINANCE": "OU=Finance,DC=example,DC=com" },
"default": "OU=Users,DC=example,DC=com" }
]
}
department = " it " → IT → OU=IT,DC=example,DC=com
department = "Finance" → FINANCE → OU=Finance,DC=example,DC=com
department = "Legal" → LEGAL → OU=Users,DC=example,DC=com
Example: build, then clean up
Because concat ignores the previous result, put it first and clean up after it.
{
"type": "pipeline",
"steps": [
{ "type": "concat", "values": ["${firstName}", ".", "${lastName}"] },
{ "type": "lowercase" },
{ "type": "replace", "search": " ", "replace": "" }
]
}
firstName = "Anna Maria", lastName = "De Souza"
→ Anna Maria.De Souza → anna maria.de souza → annamaria.desouza
Example: branch on an attribute
An if step passes the current value into whichever branch it picks, so a branch can keep transforming it. Here contractors get a c- prefix on their login name.
{
"type": "pipeline",
"steps": [
{ "type": "split", "input": "${email}", "delimiter": "@", "index": 0 },
{ "type": "lowercase" },
{ "type": "if",
"when": { "employeeType": "Contractor" },
"then": { "type": "regex", "pattern": "^", "replacement": "c-" },
"else": { "type": "trim" } }
]
}
email = "Priya.Sharma@example.com", employeeType = "Employee"
→ Priya.Sharma → priya.sharma → priya.sharma
email = "Ravi.Kumar@example.com", employeeType = "Contractor"
→ Ravi.Kumar → ravi.kumar → c-ravi.kumar
Troubleshooting
- The pipeline returns no value. A step returned no value and the steps after it had nothing to work on. A step with no
inputas the first step of a top-level pipeline also has nothing to work on. Give the first step aninput. - An earlier step seems to be ignored. A later step has its own
input, or is a type that ignores the previous result, such asconcat. - A step's options can't refer to the current value. Tokens read attributes only. Steps receive the current value only as their input.
