Skip to content

Instantly share code, notes, and snippets.

@Beninetti
Last active January 20, 2023 19:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Beninetti/31d04100107d7e8fffe5a99ccca19282 to your computer and use it in GitHub Desktop.
Save Beninetti/31d04100107d7e8fffe5a99ccca19282 to your computer and use it in GitHub Desktop.
A formula written to create an email ready string based on the special character formatted values from separate first and last name fields.
IF(
AND(
{first_name},
{last_name}
),
IF(
REGEX_MATCH(
TRIM({first_name}) & TRIM({last_name}),
"[áàâåæçèéëêîïìñôöòøõùûüýíúşó]"
),
REGEX_REPLACE(
REGEX_REPLACE(
REGEX_REPLACE(
REGEX_REPLACE(
REGEX_REPLACE(
REGEX_REPLACE(
REGEX_REPLACE(
REGEX_REPLACE(
REGEX_REPLACE(
REGEX_REPLACE(
REGEX_REPLACE(
REGEX_REPLACE(
REGEX_REPLACE(
TRIM(LOWER({first_name} & "." & {last_name})),
"ó", "o"
),
"ş", "s"
),
"ú", "u"
),
"í", "i"
),
"ý", "y"
),
"[ùûü]", "u"
),
"[ôöòøõ]", "o"
),
"ñ", "n"
),
"[îïì]", "i"
),
"[èéëê]", "e"
),
"ç", "c"
),
"æ", "ae"
),
"[áàâå]", "a"
),
TRIM(LOWER({first_name} & "." & {last_name}))
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment