Skip to content

Filters ​

A filter transforms a value. Write the input first, then |, the filter name, and any arguments:

liquid
{{ process.name | default: "Untitled" | upcase }}

This page lists the filters supported in Nawfe's workflow templates. Formula means the filter is also allowed in form logic formulas. Formula expressions must still start with a current field reference, such as {{ fields.name.value | upcase }}; a filter's availability does not allow workflow variables or tags inside a formula.

The reference tables show the input separately from the filter call. For example, input 5 and call plus: 3 mean {{ 5 | plus: 3 }}. Literal inputs make the behavior easy to reproduce in a workflow template.

Defaults and conversion ​

Filter callInputResult / behaviorFormula
default: "Unknown"""Unknown; also replaces missing/null, false, and empty arraysYes
default: true, allow_false: truefalsefalse; preserves a false booleanYes
to_integer"12.8"12.8; converts to a number, preserving the fractionNo
json"Ada""Ada", including JSON quotes; also serializes arrays and objectsNo
jsonify"Ada"Same as jsonNo
inspect"Ada"JSON-like inspection output for examining a valueNo

default preserves numeric zero. It does not replace whitespace-only text; put strip before it when spaces should count as missing. json and inspect accept an optional indentation width, such as json: 2. Inspection output is useful while editing a template; remove it before sending content to recipients who should not see the full object.

Numbers ​

Filter callInputResult / behaviorFormula
plus: 358Yes
minus: 352Yes
times: 3515Yes
divided_by: 252.5Yes
modulo: 352, the remainderYes
abs-55Yes
at_least: 10510, enforcing a minimumYes
at_most: 101510, enforcing a maximumYes
ceil2.13Yes
floor2.92Yes
round: 22.4562.46; omit the argument to round to a whole numberYes

Division keeps fractional results even when both inputs are whole numbers. Add floor, ceil, or round if you need a whole number. Guard a divisor with a rule or condition when it could be zero. Math filters calculate values; they do not format currency or guarantee a fixed number of visible decimal places.

liquid
{{ 100 | plus: 25 | times: 1.1 | round: 2 }}

This produces 137.5, not 137.50. Use number_fmt when the result is display text and needs locale-aware formatting.

Text ​

Filter callInputResult / behaviorFormula
append: "!""Ready"Ready!Yes
prepend: "REF-""123"REF-123Yes
capitalize"hELLO WORLD"Hello worldYes
upcase"Ready"READYYes
downcase"Ready"readyYes
strip" Ada "Ada; trims both endsYes
lstrip" Ada "Ada ; trims the startYes
rstrip" Ada " Ada; trims the endYes
strip_newlinesText containing line breaksRemoves line breaksYes
remove: "na""banana"ba; removes every matchYes
remove_first: "na""banana"banaYes
remove_last: "na""banana"banaYes
replace: "a", "o""banana"bononoYes
replace_first: "a", "o""banana"bonanaYes
replace_last: "a", "o""banana"bananoYes
split: ",""red,blue"Array ["red", "blue"]Yes
slice: 1, 3"Nawfe"awf; start index and optional lengthYes
size"Nawfe"5; also counts array itemsYes
truncate: 8"Hello world"Hello...; length includes the endingYes
truncatewords: 2"one two three"one two...Yes
normalize_whitespace"one two"one two; collapses whitespace runsNo
squish" one two "one two; collapses and trims whitespaceNo
number_of_words"one two three"3No
array_to_sentence_string: "and"["red", "blue", "green"]red, blue, and greenNo

truncate and truncatewords accept a custom ending as their second argument, such as truncate: 8, "…". slice also works on arrays and accepts negative indexes to count from the end. The strip filters accept an optional string of characters to trim. Replacements use literal text, not regular expressions.

HTML, URLs, and encoding ​

Filter callInputResult / behaviorFormula
escape"<b>A&B</b>"Escapes HTML characters, including angle brackets and ampersandsYes
escape_once"A &amp; B"Preserves the existing entity rather than escaping it againYes
strip_html"<b>Ada</b>"Ada; removes HTML tagsYes
newline_to_brText containing a line breakInserts an HTML <br /> for the line breakYes
xml_escape"A&B"A&amp;B; escapes XML charactersNo
url_encode"hello world"hello+world; encodes a URL component, using + for spacesNo
url_decode"hello%20world"hello worldNo
cgi_escape"hello world"hello+world; CGI-style component encodingNo
uri_escape"hello world"hello%20world; URI encoding that preserves URI separatorsNo
slugify"Hello World"hello-worldNo
base64_encode"hello"aGVsbG8=No
base64_decode"aGVsbG8="helloNo
sha256"hello"SHA-256 digest as a hexadecimal stringNo
hmac_sha256: "example-key""hello"HMAC-SHA256 digest using the supplied keyNo

Choose escaping for the destination: HTML text, a URL component, and a JSON string need different treatment. HTML filters do not make a form field render HTML if the field is plain text. Base64 is an encoding, not encryption. Use HTTP request credentials and signing settings for integration secrets rather than putting secrets into a template.

slugify accepts an optional mode ("default", "pretty", "ascii", "latin", "raw", or "none") and an optional boolean to preserve case, for example slugify: "ascii", true.

Arrays and object collections ​

The examples in this section assume these sample values. In a workflow, replace the sample variable with a real array selected from the variable picker.

json
{
  "tags": ["red", "blue", "red"],
  "other_tags": ["green"],
  "numbers": [10, 20, 30],
  "values": ["red", null, "blue"],
  "rows": [
    { "name": "Ada", "team": "Ops", "amount": 20, "active": true },
    { "name": "Ben", "team": "Sales", "amount": 10, "active": false },
    { "name": "Cy", "team": "Ops", "amount": 30, "active": true }
  ]
}

Arrays and objects shown below describe the returned value. Use json to print that structure, join to make text, or a for tag to render each item.

Filter callInputResult / behaviorFormula
firsttagsredYes
lasttagsredYes
join: ", "tagsred, blue, redYes
sizetags3Yes
slice: 1, 1tags["blue"]Yes
map: "name"rows["Ada", "Ben", "Cy"]No
sumnumbers60No
sum: "amount"rows60No
sort: "amount"rowsRows in ascending amount order: Ben, Ada, CyNo
sort_natural: "name"rowsRows ordered by name, ignoring caseNo
reversenumbers[30, 20, 10]No
uniqtags["red", "blue"]No
compactvalues["red", "blue"]; removes missing/null entriesNo
concat: other_tagstags["red", "blue", "red", "green"]No
push: "green"tagsAdds green at the end of the returned arrayNo
unshift: "green"tagsAdds green at the start of the returned arrayNo
poptags["red", "blue"]; removes the last item from the resultNo
shifttags["blue", "red"]; removes the first item from the resultNo
sample: 2tagsTwo randomly selected items; omit the count for a single itemNo
where: "team", "Ops"rowsAda and Cy rowsNo
reject: "team", "Ops"rowsBen row, in an arrayNo
find: "team", "Ops"rowsFirst matching row: Ada; missing if there is no matchNo
find_index: "team", "Ops"rows0, the first matching zero-based index; missing if no matchNo
has: "team", "Ops"rowstrue if any row matchesNo
group_by: "team"rowsGroups with name and items: Ops contains Ada/Cy, Sales contains BenNo
where_exp: "row", "row.amount >= 20"rowsAda and Cy rowsNo
reject_exp: "row", "row.amount >= 20"rowsBen row, in an arrayNo
find_exp: "row", "row.amount >= 20"rowsAda rowNo
find_index_exp: "row", "row.amount >= 20"rows0No
has_exp: "row", "row.amount >= 20"rowstrueNo
group_by_exp: "row", "row.team"rowsGroups by the evaluated team valueNo

Without a property, sort and sort_natural sort the items themselves. Property-based selection filters can omit the expected value to select truthy properties, such as where: "active". Expression filters take a local item name and a quoted Liquid expression; they do not run JavaScript.

Array transformations only affect the rendered result. They do not add, remove, or update stored records. sample is random and should not drive repeatable compliance or approval decisions.

Render a collection ​

This workflow template renders each tag and handles an empty collection:

liquid
{% assign tags = process.tags | uniq | sort %}
{% for tag in tags %}
  {{ forloop.index }}. {{ tag | escape }}
{% else %}
  No tags
{% endfor %}

Date filters ​

These filters are available in workflow templates only. They do not use Nawfe's date_fmt format names or its workspace-aware formatting contract.

Filter callInputResult / behavior
date: "%Y-%m-%d", "+0000""2026-10-24T14:30:00Z"2026-10-24, using strftime-style tokens and a fixed UTC offset
date_to_xmlschema"2026-10-24T14:30:00Z"XML Schema / ISO-style datetime
date_to_rfc822"2026-10-24T14:30:00Z"RFC 822-style date
date_to_string"2026-10-24T14:30:00Z"Short month format, such as 24 Oct 2026
date_to_long_string"2026-10-24T14:30:00Z"Long month format, such as 24 October 2026

Prefer date_fmt for workflow-facing dates so workspace locale and timezone apply. Do not mix %Y-%m-%d from date with yyyy-LL-dd from date_fmt.

Formatting and locale helpers ​

These filters are available in workflow templates only.

to_string ​

Converts a value to text. Use it for a primitive value; use json when you need a serialized object or array.

liquid
{{ 42 | to_string | append: " items" }}

Result: 42 items.

deburr ​

Removes supported Latin accents and combining marks. It is not general transliteration for every writing system.

liquid
{{ "déjà vu" | deburr }}

Result: deja vu.

number_fmt ​

Formats a number using the resolved locale. Workflows use the workspace locale, with en-US as the fallback.

liquid
{{ 12345.67 | number_fmt }}

For en-US, the result is 12,345.67. Other locales use their own separators.

date_fmt ​

Formats a date using the workspace's locale and timezone:

liquid
{{ processExecution.createdAt | date_fmt }}
{{ processExecution.createdAt | date_fmt: "DATE_MED" }}
{{ processExecution.createdAt | date_fmt: "yyyy-LL-dd HH:mm" }}

The format argument is a preset name or a custom date/time pattern using the tokens below. The default is DATETIME_SHORT.

If no workspace settings are available, the fallbacks are en-US and UTC.

Use ISO inputs for predictable date interpretation. The handler also accepts supported natural-language values such as "now", "tomorrow", "in 3 days", and "2 hours ago". Relative values are evaluated at render time, not when the workflow was authored.

liquid
{{ "tomorrow" | date_fmt: "ISO_DATE" }}
{{ "2026-10-24T14:30:00Z" | date_fmt: "yyyy-LL-dd" }}

The second result is 2026-10-24 in UTC; timezone conversion can change the date when the input is near midnight.

Available presets:

FamilyPresets
DatesDATE_SHORT, DATE_MED, DATE_MED_WITH_WEEKDAY, DATE_FULL, DATE_HUGE
TimesTIME_SIMPLE, TIME_WITH_SECONDS, TIME_WITH_SHORT_OFFSET, TIME_WITH_LONG_OFFSET
24-hour timesTIME_24_SIMPLE, TIME_24_WITH_SECONDS, TIME_24_WITH_SHORT_OFFSET, TIME_24_WITH_LONG_OFFSET
DatetimesDATETIME_SHORT, DATETIME_MED, DATETIME_MED_WITH_WEEKDAY, DATETIME_FULL, DATETIME_HUGE
Datetimes with secondsDATETIME_SHORT_WITH_SECONDS, DATETIME_MED_WITH_SECONDS, DATETIME_FULL_WITH_SECONDS, DATETIME_HUGE_WITH_SECONDS
ISO and interchangeISO, ISO_DATE, ISO_TIME, RFC2822, HTTP, FILESTAMP
Date partsYEAR, YEAR_SHORT, MONTH, MONTH_SHORT, MONTH_NUM, MONTH_NUM_SHORT, DAY, DAY_SHORT, DAY_NUM, DAY_NUM_SHORT

DAY is the weekday name; DAY_NUM is the day of the month. MONTH_NUM and DAY_NUM are zero-padded; the _SHORT variants are not. FILESTAMP uses yyyyLLdd_HHmmss. The HTTP preset always uses UTC.

Useful custom tokens:

TokenMeaning
yyyyFour-digit year
LL, ddTwo-digit month and day of month
HH, mm, ss24-hour hour, minute, and second
LLLL, cccLocalized month name and abbreviated weekday

get_locale ​

Returns the resolved locale. Its input value is ignored.

liquid
{{ "" | get_locale }}

For a workspace using US English, this produces en-US.

get_tz ​

Returns the workspace's timezone:

liquid
{{ "tenant" | get_tz }}

For a workspace configured for Chicago, the result is America/Chicago.

Formula filter list ​

Form logic allows only the filters marked Yes above:

text
abs, append, at_least, at_most, capitalize, ceil, default, divided_by,
downcase, escape, escape_once, first, floor, join, last, lstrip, minus,
modulo, newline_to_br, plus, prepend, remove, remove_first, remove_last,
replace, replace_first, replace_last, round, rstrip, size, slice, split,
strip, strip_html, strip_newlines, times, truncate, truncatewords, upcase

For a formula example, replace the literal input with a field reference:

liquid
{{ fields.email.value | strip | downcase }}
{{ fields.amount.value | default: 0 | at_least: 0 | round: 2 }}

See Form formulas for setup and validation.