Filtering with Message Template Variables
Last updated
Was this helpful?
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.
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}}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
{{patient.first_name | upcase}}
{{patient.last_name | downcase}}Display a fallback when the variable is empty:
Limit the number of characters displayed:
Multiple filters can be chained together:
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?
Was this helpful?
{{patient.phone | default: "No phone on file"}}{{patient.notes | truncate: 100}}{{patient.first_name | upcase | default: "Patient"}}