Skip to main content

Modifiers

Modifiers let you transform Input Variables directly inside Flow nodes and schemas. The syntax is inspired by Shopify's Liquid. Chain filters with | and pass arguments using : and commas.

Example

{
"title": "{$input.title | strip | upcase}",
"summary": "{$input.description | strip_newlines | truncatewords: 20}",
"tags": "{$input.tags | sort_natural | join: ', '}",
"slug": "{$input.title | handleize}",
"price": "{$input.price | divided_by: 100 | round: 2}",
"fallback": "{$input.optional | default: 'N/A'}"
}

Supported modifiers

Many mirror Liquid’s behavior; key differences are noted below.

Strings

  • upcase, downcase
  • capitalize
  • titlecase
  • strip, lstrip, rstrip, strip_newlines
  • replace: search, replacement
  • replace_first: search, replacement
  • replace_last: search, replacement
  • remove: search, remove_first: search
  • replace_regex: pattern, replacement (regex global)
  • truncate: length[, ellipsis] (default length 50, ellipsis "...")
  • truncatewords: words[, ellipsis] (default 15, ellipsis "...")
  • slice: start[, length] (negative start supported; strings and arrays)
  • split: separator
  • camelcase
  • escape, escape_once (HTML)
  • url_encode, url_decode
  • strip_html
  • newline_to_br
  • handle, handleize (slugify with accent removal)
  • append: value, prepend: value
  • toString, toNumber, toBoolean

Arrays / collections

  • reverse (non‑mutating; works on strings too)
  • first, last
  • uniq
  • concat: otherArrayOrValue (non-arrays treated as single-element arrays; nil becomes empty)
  • map: key
  • where: key[, value] (truthy filter when value omitted; loose string comparison when provided)
  • sort[, key]
  • sort_natural[, key] (locale-aware, numeric)
  • compact (removes null/undefined; keeps false and 0)
  • join: separator
  • sample (returns a random element from an array)
  • parse_json (parses a JSON string into an object/array)
  • join: separator
  • sample (returns a random element from an array)
  • parse_json (parses a JSON string into an object/array)
  • group_by: key (groups array of objects by key, returns [{ name, items }])

Numbers / math

  • plus: n, minus: n
  • times: n (decimal‑safe)
  • divided_by: n (guarded, decimal‑aware; returns number)
  • modulo: n
  • round[: digits] (default 0; improved rounding stability)
  • ceil, floor, abs
  • at_least: n, at_most: n

Dates

  • date: format — strftime-style formatting. Supported tokens include:
    • Basic: %Y %y %m %d %H %I %M %S %p %a %A %b %B %%
    • Advanced: %z (timezone offset), %j (day of year), %s (epoch seconds)

JSON / encoding

  • json, jsonify

Control / other

  • size (string/array/object length)
  • default: value[, allow_false] — when allow_false is 'true', false is considered present; otherwise false is treated as empty
  • pluralize: singular, plural

Usage tips

  • Chain left to right: {$input.title | strip | upcase}.
  • Arguments: {$input.tagline | truncate: 50, '...'}; {$input.tags | join: ', '}.
  • Multiple placeholders in a string: missing values become empty strings; a single placeholder that resolves to undefined removes the field.
  • reverse is non‑mutating; original arrays aren’t changed.

Examples

String formatting

{
"headline": "{$input.title | strip | capitalize}",
"handle": "{$input.title | handleize}",
"summary": "{$input.body | strip_newlines | truncatewords: 30}",
"safe_html": "{$input.html | escape_once}",
"no_tags": "{$input.html | strip_html}",
"mask_last4": "{$input.code | slice: -4}"
}

Arrays / collections

{
"first_tag": "{$input.tags | first}",
"sorted": "{$input.tags | sort_natural | join: ', '}",
"unique": "{$input.tags | uniq | join: ', '}",
"pluck_ids": "{$input.items | map: 'id' | compact | join: ','}",
"filtered_active_count": "{$input.items | where: 'active', true | size}",
"concat_value": "{$input.tags | concat: 'featured' | join: ', '}"
}

Math / control

{
"price": "{$input.cents | divided_by: 100 | round: 2}",
"safe_name": "{$input.name | default: 'Untitled'}",
"false_ok": "{$input.flag | default: 'fallback', true}",
"bounded": "{$input.score | at_least: 0 | at_most: 100}"
}

Dates

{
"short": "{$input.date | date: '%Y-%m-%d'}",
"with_tz": "{$input.date | date: '%Y-%m-%d %H:%M %z'}",
"doy": "{$input.date | date: '%j'}",
"epoch": "{$input.date | date: '%s'}"
}

Additional examples

{
"parsed": "{$input.json_string | parse_json | json}",
"random_tag": "{$input.tags | sample}",
"grouped": "{$input.items | group_by: 'category' | json}",
"capitalized": "{$input.title | capitalize}",
"titlecased": "{$input.title | titlecase}",
"regex_replace": "{$input.text | replace_regex: '\\d+', '[num]'}",
"keep_false": "{$input.flag | default: 'fallback', 'true'}"
}

Comprehensive examples (one example per filter, ordered to match the lists above)

{
"upcase": "{$input.name | upcase}",
"downcase": "{$input.name | downcase}",
"capitalize": "{$input.title | capitalize}",
"titlecase": "{$input.title | titlecase}",
"strip": "{$input.raw | strip}",
"lstrip": "{$input.raw | lstrip}",
"rstrip": "{$input.raw | rstrip}",
"strip_newlines": "{$input.longtext | strip_newlines}",
"replace": "{$input.greeting | replace: 'Hello', 'Hi' }",
"replace_first": "{$input.greeting | replace_first: 'o', '0' }",
"replace_last": "{$input.path | replace_last: '/', '' }",
"remove": "{$input.body | remove: '<br>' }",
"remove_first": "{$input.body | remove_first: '<br>' }",
"replace_regex": "{$input.text | replace_regex: '\\d+', '[num]' }",
"truncate": "{$input.summary | truncate: 30 }",
"truncatewords": "{$input.summary | truncatewords: 5 }",
"slice": "{$input.code | slice: -4 }",
"split": "{$input.csv | split: ',' }",
"camelcase": "{$input.phrase | camelcase }",
"escape": "{$input.html | escape }",
"escape_once": "{$input.html | escape_once }",
"url_encode": "{$input.url | url_encode }",
"url_decode": "{$input.encoded | url_decode }",
"strip_html": "{$input.html | strip_html }",
"newline_to_br": "{$input.notes | newline_to_br }",
"handleize": "{$input.title | handleize }",
"append": "{$input.name | append: ' Jr.' }",
"prepend": "{$input.name | prepend: 'Dr. ' }",
"toString": "{$input.num | toString }",
"toNumber": "{$input.str_num | toNumber }",
"toBoolean": "{$input.flag | toBoolean }",

"reverse": "{$input.items | reverse }",
"first": "{$input.items | first }",
"last": "{$input.items | last }",
"uniq": "{$input.tags | uniq }",
"concat": "{$input.tags | concat: 'featured' }",
"map": "{$input.products | map: 'id' }",
"where": "{$input.products | where: 'available', true }",
"sort": "{$input.list | sort }",
"sort_natural": "{$input.list | sort_natural }",
"compact": "{$input.maybe | compact }",
"join": "{$input.items | join: ', ' }",
"sample": "{$input.tags | sample }",
"parse_json": "{$input.json_text | parse_json }",
"group_by": "{$input.items | group_by: 'category' }",

"plus": "{$input.price | plus: 5 }",
"minus": "{$input.price | minus: 2 }",
"times": "{$input.qty | times: 2 }",
"divided_by": "{$input.amount | divided_by: 100 }",
"modulo": "{$input.count | modulo: 10 }",
"round": "{$input.value | round: 2 }",
"ceil": "{$input.value | ceil }",
"floor": "{$input.value | floor }",
"abs": "{$input.delta | abs }",
"at_least": "{$input.score | at_least: 0 }",
"at_most": "{$input.score | at_most: 100 }",

"date": "{$input.date | date: '%Y-%m-%d' }",

"json": "{$input.obj | json }",
"jsonify": "{$input.obj | jsonify }",

"size": "{$input.items | size }",
"default": "{$input.whatever | default: 'fallback' }",
"pluralize": "{$input.count | pluralize: 'item', 'items' }"
}