What is function nesting?
Function nesting is the traditional way of combining functions. You place one function call inside another, and the innermost function executes first. The result flows outward through each layer.
Here's an example:
UPCASE(REPLACE(my_event.url, "http", "https"))Translation: For the value of my_event.url reference path, Replace every occurrence of "http" with "https", then capitalize the entire value after the replace is complete. So, if our URL was previously:
http://www.tines.comAfter the action runs, the event output would display the updated value:
HTTPS://WWW.TINES.COMWhen to use function nesting
You're combining two or three simple functions. For quick, straightforward transformations, nesting is concise and doesn't require extra syntax. If you're wrapping one function around another, nesting is perfectly readable.
UPCASE(STRIP(user_input))You're working with functions that take multiple arguments. Some formulas require several inputs, and nesting can keep everything contained in one expression.
IF(SIZE(alerts) > 10, "High volume", "Normal")You want a more compact view of your formula. In some configurations or quick calculations, a nested formula keeps everything on one line without breaking the visual flow.
What is function chaining?
Function chaining uses the pipeline operator (|>) to connect functions in the order they execute. The output of one function becomes the input to the next, represented by the % placeholder.
Here's the same formula example we looked at in nesting, but using chaining instead:
REPLACE(my_event.url, "http", "https") |> UPCASE(%)This reads left to right: REPLACE runs first, then its result (represented by %) is passed to UPCASE. Chaining makes the execution order explicit and visual.
When to use function chaining
You're performing four or more operations in sequence. Once you start stacking multiple transformations, chaining makes each step clear and easy to follow. You can read the formula like a recipe:
WHERE(incidents, "status", "open")
|> MAP(%, "title")
|> UNIQ(%)
|> SORT(%)You're building complex data pipelines for pages. When preparing datasets for tables, dropdowns, or filters, chaining lets you see exactly how the data flows from raw input to Page-ready output.
You might need to debug or modify formulas later. Chained formulas are easier to troubleshoot because you can test each step independently. You can also insert new transformations in the middle without rewriting the entire expression.
You're collaborating with teammates. Chained formulas are more readable for others reviewing your work. The logic is sequential and self-documenting.
Why both techniques matter
Here's the key insight: Function nesting and function chaining aren't competing techniques; they're complementary tools.
Nesting is efficient for simple, self-contained operations. It keeps your formulas tight and focused when you don't need to spell out every step.
Chaining is powerful for complex, multi-step transformations. It makes your intent clear and your formulas maintainable when you're orchestrating data through several operations.