Skip to content

Transforming directory field data with regex and Liquid

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.

Each input example is shown with its output format:

6043334567
(604) 333-4567
604-333-4567
604.333.4567
6043334567 x1234 (with extension)
604.333.4567
Any format stored in AD
604.333.4567 or 604-333-4567
Transformation Input example Output example
Flip name orderDoe, JaneJane Doe
All uppercasejane doeJANE DOE
All lowercaseJANE DOEjane doe
Remove specific charactersDirector - SalesDirector
Trim whitespace[space] Jane DoeJane Doe

You can configure transformations with either regex transforms or Liquid, depending on what you need.

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 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.

Scenario Use
Phone number formatting (any common format)Regex transforms (formatPhone)
Name order (Last, First to First Last)Regex transforms (flipNameComma)
Case standardizationRegex transforms (toUpperCase or toLowerCase)
Trimming leading or trailing whitespaceRegex transforms (trim)
Removing or replacing specific charactersLiquid
Conditional output or fallback valuesLiquid
Complex multi-step logic not covered by built-in keywordsLiquid

For further help, contact Opensense Support at help@opensense.com.

Screenshot preview

Screenshot