Filtering with Message Template Variables
Overview
Message template variables in Welkin can be filtered and formatted to control how dynamic data appears in your communication templates. This is useful when you want to display a date in a specific format, truncate long text, or conditionally show values.
What is Variable Filtering?
When you insert a variable like {{patient.date_of_birth}} into a message template, you can apply a filter to transform the output. Filters are appended to the variable using a pipe character (|).
Syntax:
{{variable_name | filter_name}}Common Filters
Date Formatting
Format dates to display in a specific way:
{{patient.date_of_birth | date: "MM/DD/YYYY"}}Supported formats: MM/DD/YYYY, YYYY-MM-DD, Month DD, YYYY
Uppercase / Lowercase
{{patient.first_name | upcase}}
{{patient.last_name | downcase}}Default Value
Display a fallback when the variable is empty:
Truncate
Limit the number of characters displayed:
Combining Filters
Multiple filters can be chained together:
Configuration
Variable filtering is configured directly in the message template editor in Designer. When adding a variable, use the filter syntax in the template body. Test templates using the preview functionality before publishing.
For basic variable usage, see Filtering Message Template Variables.
Last updated
Was this helpful?