Create a list of email addresses from the values in EnumList

How do I create a list of email addresses from a comma spelled name list?

The Users table contains the user’s name and email address columns.
The Report form has an EnumList created from the Name column in the Users table, but when AppSheet sends an email, it must be an email address, not a name.

I tried the following formula, but it could only LOOKUP the first email address.
SPLIT (LOOKUP ([name], “Users”, “name”, “mail”), “,”)

Solved Solved
0 4 1,167
1 ACCEPTED SOLUTION

LOOKUP can only operate on single row and will return only a single value of the column from that row.

You need an expression that returns a list of emails gathered from different rows where the “name” in those rows is contained in your EnumList of names. A SELECT() expression can help and It would look something like this:

SELECT(Users[mail], IN([Name], [_THISROW].[EnumList of Names Column]))

Just replace “EnumList of Names Column” with the actual name of the EnumList column. Also, its not clear WHERE in your app you are using this expression. It’s possible there might need to be some slight adjustment based on that context.

Give it a try and let us know.

View solution in original post

4 REPLIES 4

LOOKUP can only operate on single row and will return only a single value of the column from that row.

You need an expression that returns a list of emails gathered from different rows where the “name” in those rows is contained in your EnumList of names. A SELECT() expression can help and It would look something like this:

SELECT(Users[mail], IN([Name], [_THISROW].[EnumList of Names Column]))

Just replace “EnumList of Names Column” with the actual name of the EnumList column. Also, its not clear WHERE in your app you are using this expression. It’s possible there might need to be some slight adjustment based on that context.

Give it a try and let us know.

wonderful!
I was able to get the expected results with your formula.
I modified the formula a bit to combine the email addresses.

CONCATENATE(SELECT(Users[mail], IN([name], [_THISROW].[name])))


Thank you so much!

Hello Emily,

I am trying to solve similar functionality as you and I would like to ask you regarding the step forward after your issue. I mean, having a list of emails in the mail column, how do you achieve that a PROCESS of sending email is taking correctly a mailing list from the mail column and send emails to that people. 

Do you have a specific formula in that form:

David_Castaneda_0-1666690837771.png

Thanks for any tip!

Best regards

David

 

Please start a new topic for help with this.

Top Labels in this Space