Name Templates β Extracting Names for Genesys Cloud
Overviewβ
Name templates allow you to configure how user names are parsed from different authentication providers (SSO, OAuth, etc.). Each provider may format names differently, and templates provide a flexible way to extract the first name, last name, and nickname from a full name string.
How It Worksβ
We use a template-based approach with placeholders that extract name components from full name strings. The template can be set on the OAuthProvider in Admin. If it is not set, the system uses the fallback name extraction described below. When the template is set, it will be used for all users authenticated via that provider, so ensure their name format is consistent.
Available Placeholdersβ
Templates support the following placeholders:
| Placeholder | Description | Example Match |
|---|---|---|
{first} | First name | "John" |
{last} | Last name | "Doe" |
{nick} | Nickname | "JD" |
{*} | Wildcard β matches any text but does not capture it | β |
Template Examplesβ
Common Name Formatsβ
1. Standard Western format
Template: {first} {last}
Input: "John Doe"
Output: first="John", last="Doe", nick="John"
2. Western format with nickname
Template: {first} {last} ({nick})
Input: "John Doe (JD)"
Output: first="John", last="Doe", nick="JD"
3. Last name first (formal)
Template: {last}, {first}
Input: "Doe, John"
Output: first="John", last="Doe", nick="John"
4. Last name first with nickname
Template: {last}, {first} ({nick})
Input: "Doe, John (JD)"
Output: first="John", last="Doe", nick="JD"
5. Nickname with last name
Template: {nick} {last}
Input: "JD Doe"
Output: first="JD", last="Doe", nick="JD"
6. Using wildcards
Template: {first} {*} {last}
Input: "John Michael Doe"
Output: first="John", last="Doe", nick="John"
(The middle name is matched by {*} but not captured)
Automatic Fallback Behaviorβ
If no template is provided or if template parsing fails, the system uses fallback logic:
-
Comma-separated format (e.g.
"Last, First (M)"):- Splits on comma
- First part = last name
- Remaining = first name
- Extracts nickname from parentheses if present
-
Space-separated format (e.g.
"First Last"):- First word = first name
- Remaining words = last name
- Extracts nickname from parentheses if present
-
Single word (e.g.
"John"):- Treated as first name only
- Last name is empty
Nickname Behaviourβ
When using a name template:
- If
{nick}is extracted but{first}is empty β first name is set to the nickname - If
{first}is extracted but{nick}is empty β nickname is set to the first name
This keeps both fields populated when possible.
When using the automatic fallback:
- If first name contains an opening parenthesis (e.g.
John (J)):- Nickname is set to the value between the parentheses (
J) - First name is updated to the part before the parentheses (
John)
- Nickname is set to the value between the parentheses (
- Otherwise nickname is left empty.
Where to Configureβ
Set the name template in Admin on the OAuthProvider record used for Genesys Cloud (or the relevant OAuth provider). See Administration β Authentication and OAuth2 Roles β Genesys Cloud for SSO and role setup.