Orchid registers 70+ custom Jinja2 filters in orchid/jinja_filters.py. Before writing Python logic inside a template, check here — the filter you need likely already exists.
How to use filters
{# Basic usage #}
{{ value | filter_name }}
{# With arguments #}
{{ value | filter_name(arg1, arg2) }}
{# Chained #}
{{ value | filter_one | filter_two }}
Formatting filters
Display and text
Filter
What it does
capitalize_words
Capitalizes every word: 'hello world' → 'Hello World'
capitalize_first
Capitalizes first character only
bool_readability
Converts boolean to 'Yes' / 'No' / '--'
bool_readability(true_text, false_text)
Custom true/false labels
clean_question_code
Removes pipes from question codes
clean_sort(attr)
Sorts a list of objects by attribute with error handling
Usage examples:
{{ name | capitalize_words }}
{{ field | bool_readability }}
{{ field | bool_readability('Active', 'Inactive') }}
{{ items | clean_sort('name') }}
Contact and address
Filter
Output
address
Multi-line formatted address (street, city, state, zip, country)
phone_readability
Formats as (555) 123-4567
email_logo_url
Public proxy URL for agency logos safe for emails
{{ contact | address }}
{{ user.phone | phone_readability }}
{{ agency | email_logo_url }}
Dates and times
Filter
Output
date_readability
January 15, 2025
time_readability
2:30 PM
from_utc(timezone)
Converts UTC datetime to local timezone
{{ case.created_at | date_readability }}
{{ event.time | time_readability }}
{{ ts | from_utc(timezone) }}
Money
Filter
Output
currency
$1,234.56
{{ amount | currency }}
Case and type mapping
Filter
What it does
case_type_filter
'surrogate' → 'GC Case', 'donor' → 'ED Case', etc.
case_type_short
'surrogate' → 'GC', 'donor' → 'ED', etc.
contract_role
'donor' → 'Egg Donor', 'surrogate' → 'Surrogate', etc.
{{ case.case_type | case_type_filter }}
{{ case.case_type | case_type_short }}
{{ role | contract_role }}
File and media filters
Filter
What it does
cloudfront
Generates a presigned CloudFront URL from an S3 key
file_icon
Returns a CSS class / icon name based on file extension