Help

Re: pull out first names from a multi-select User field

1959 1
cancel
Showing results for 
Search instead for 
Did you mean: 
kts
5 - Automation Enthusiast
5 - Automation Enthusiast

I have a User field that allows multiple users to be tagged. I'd like to write a formula that will pull those people's first names into a comma-delimited list. I came up with the following:

LEFT({Users}, FIND(" ", {Users})-1)

...which does the trick if there's just one person tagged. But if multiple people are tagged, the formula only returns the first name of the first person.

Is there a way to make this work? I have a feeling this might require a REGEX formula though I'm not so clear on how they work...

Thank you!

5 Replies 5
Sho
11 - Venus
11 - Venus

Hello, @kts 
Yes, it is true that REGEX is difficult to understand
Can you show a few examples of inputs and ideal outputs?

kts
5 - Automation Enthusiast
5 - Automation Enthusiast

Sure thing @Sho! If the list of contributors is:

Jane Doe, Joe Smith, Johnny Appleseed

The output should ideally be:

Jane, Joe, Johnny

@Sho wrote:

Hello, @kts 
Yes, it is true that REGEX is difficult to understand
Can you show a few examples of inputs and ideal outputs?




Sho
11 - Venus
11 - Venus

A simple way to do this is to create a "Short Name" formula field in the "Users" table and put your formula in it.
Then, from the linked table, you can lookup or rollup the "Short Name" field to get the list.

kts
5 - Automation Enthusiast
5 - Automation Enthusiast

That makes sense, but in this case, I'm using a Collaborator/User field that links directly to Airtable users, rather than using a linked record to a separate Team table.

Sho
11 - Venus
11 - Venus

Oh, yes, it was a user field
I know it's weird, but how about this!

 

REGEX_REPLACE(
LEFT(REGEX_EXTRACT(Users,"([^ ]* ?){1}"),3)&", "&
LEFT(REGEX_EXTRACT(Users,"([^ ]* ?){3}"),3)&", "&
LEFT(REGEX_EXTRACT(Users,"([^ ]* ?){5}"),3)&", "&
LEFT(REGEX_EXTRACT(Users,"([^ ]* ?){7}"),3)&", "&
LEFT(REGEX_EXTRACT(Users,"([^ ]* ?){9}"),3)&", "&
LEFT(REGEX_EXTRACT(Users,"([^ ]* ?){11}"),3)
,"(, ){2,}|, $","")

 

The number needs to be increased by 2 for each maximum number of users.