Help

Welcome to the Airtable Community! If you're new here, check out our Getting Started area to get the most out of your community experience.

Extract text before first comma in lookup field

Topic Labels: Formulas
Solved
Jump to Solution
783 2
cancel
Showing results for 
Search instead for 
Did you mean: 

Hello Airtable world,
We’re trying to extract customer’s names from a lookup field of a synced table where the names sometimes include a second name after the comma. Our data usually looks like this:

John Smith
Jane Doe, Terry Doe
James Bond

We’d like to be able to have a column that displays the following:

John Smith
Jane Doe
James Bond

So far we’ve tried the functions below, both returning and error.
IF({Customer's Name}, REGEX_EXTRACT({Customer's Name}, "[^,]*"))
LEFT({Customer's Name}, FIND(",", {Customer's Name}) -1)

The number of characters is unpredictable both, before and after the comma. I suspect the biggest issue is that our primary field from which we’re hoping to pull information is a lookup field and not just simple text. Is there a solution to achieving this?

1 Solution

Accepted Solutions

Lookups usually return as arrays, and the functions you’re using only work on strings. Solve this by replacing {Customer's Name} with {Customer's Name}&"", which converts the array into a string.

See Solution in Thread

2 Replies 2

Lookups usually return as arrays, and the functions you’re using only work on strings. Solve this by replacing {Customer's Name} with {Customer's Name}&"", which converts the array into a string.

Amazing, thank you so much!