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”), “,”)

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.

3 Likes

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!

3 Likes