Formula for cleaning up a person’s first name
Formula for cleaning up a person’s first name:
{{Person First Name}}.match(/\((.*?)\)/)
? {{Person First Name}}.match(/\((.*?)\)/)[1]
: {{Person First Name}}
.split(' ')
.filter(n => n.length > 2 || (n.length > 1 && !n.includes('.')))
.map(n => n.charAt(0).toUpperCase() + n.slice(1).toLowerCase())
.join(' ')Single-line version: {{Person First Name}}.match(/\((.*?)\)/) ? {{Person First Name}}.match(/\((.*?)\)/)[1] : {{Person First Name}}.split(' ').filter(n => n.length > 2 || (n.length > 1 && !n.includes('.'))).map(n => n.charAt(0).toUpperCase() + n.slice(1).toLowerCase()).join(' ') I use the formula above to clean a person’s first name. It does the following:
- 1.
Looks for a name in parentheses (usually indicates the name the recipient prefers to use), and if there is a match, uses that name
- 2.
If no parentheses, then removes any initials (“J.“) and turns the name into camel case (i.e. capitalized first letter followed by lowercase)
Make sure to update {{Person First Name}} to the actual column name in your table.

