Transforming directory field data with regex and Liquid
Overview
Section titled “Overview”Field transformations reformat data from your directory before it appears in email signatures, without changing anything in your identity provider. This is useful when your directory stores data in a format that differs from how it should be displayed, such as unformatted phone numbers, or names stored in last-first order.
What you can do
Section titled “What you can do”Phone number formatting
Section titled “Phone number formatting”Each input example is shown with its output format:
6043334567(604) 333-4567604-333-4567604.333.45676043334567 x1234(with extension)604.333.4567- Any format stored in AD
604.333.4567or604-333-4567
Text formatting
Section titled “Text formatting”Two approaches
Section titled “Two approaches”You can configure transformations with either regex transforms or Liquid, depending on what you need.
Regex transforms
Section titled “Regex transforms”Regex transforms are configured in the Transforms panel under each field mapping. Steps run in sequence, and each step receives the output of the previous one. Built-in keywords handle common operations, without your having to write custom patterns:
formatPhone- Normalizes digits into a standard phone format.
flipNameComma- Converts "Last, First" to "First Last".
toUpperCase,toLowerCase- Changes the case.
trim- Removes leading and trailing whitespace.
space- Inserts or matches a literal space.
Liquid
Section titled “Liquid”Liquid is entered directly in the Source field. It handles scenarios that regex transforms aren’t suited for, such as removing or replacing specific characters, conditional logic, fallback values when a field is empty, or custom string manipulation beyond what the built-in keywords support.
Which approach to use
Section titled “Which approach to use”
What’s next
Section titled “What’s next”- Showing signature elements based on a field value (Liquid templates)
- How often Opensense syncs user data
For further help, contact Opensense Support at help@opensense.com.

