I am setting up an automated email and want it to go to the email (will be multiple emails) from a lookup field that has the email address in it. When inserting the Data from the Record and selecting the property that has the emails in it, it gives me options. I can not get any of them to work! The error is that the “To” input is empty.
Welcome to the Airtable community!
The “To” option needs a comma separated list, but a lookup returns an array (which is a different type of list).
Try using a rollup field instead of a lookup field. Use this rollup formula to insert commas between the email addresses, remove duplicates, and remove blank values.
ARRAYJOIN(ARRAYUNIQUE(ARRAYCOMPACT(values)), ", ")
If this does not work, also check to make sure that the rollup field in your record has at least one valid email address in it.
Hope this help! Please report back.
Sorry…new to this… but the Rollup Field doesn’t have a place for a formula. Not sure what you mean.
The rollup configuration screen is too tiny on many screens. You may have to scroll down to find the place to put the formula.
I want to create an automation to send daily summaries to my teams about the tasks to do for the next day. For this I have a roolup column with their email addresses and I use an automation find records to get their email addresses.
The only problem is that I can’t add these email addresses in the TO line of the email.
I’ve tried your configuration @kuovonne but I can only put length values and not email values.
Do you have any tips for me ?
Welcome to the Airtable community!
The problem is that the find records action does not work the way you want. The find records action was designed to send an html grid of records in the body of a single email.
The information in this thread was about getting email addresses from a single field in the triggering record, not the result of a find.
Than you @kuovonne
Do tou have any idea to help me to do what I explain ?
(Sorry for my bad english)
Automations have limitations with calculated fields. I do not think you can get the email addresses from a rollup in a find action.
Do you think a formula field will works with Arrayjoin ?
Edit: I think I found the issue…not all records have an email address…will update with solution.
Hi @kuovonne I’m wondering if you might be able to support me on this same issue. I’m working to set up an automation but am receiving the “To Field Invalid” error message. I’ve tried to follow your recommendations here but I can’t get it to cooperate. I’ve confirmed the emails are valid and that the record Airtable is testing has a valid email.
The parameters are as follows:
-Emails are listed in Table 1 in an email field
-Table 2 has a lookup field that populates a person’s name from table 1, and a rollup field using
ARRAYJOIN(ARRAYUNIQUE(ARRAYCOMPACT(values)), ", ") to retrieve the associated emails from Table 1.
-Table 3 has a rollup field with the same formula in it to retrieve the emails from table 2.
Thanks for any help you can provide! Screenshots below:
It is difficult to diagnose these issues from afar. Here are some general ideas to help you out.
When testing the automation, make sure that you know exactly which records are going to be used in the test (I usually do this by having a slightly different trigger from the final trigger.)
Always retest your trigger before testing any other actions in the automation, and always test each step in the automation in order every time. This means you must retest the trigger and the find action before testing the email.
", "(with a space after the comma) versus
","(no space) in
ARRAYJOIN()makes a difference. I do not remember off the top of my head if it matters in automation emails.
It sounds like you are trying to get an email from two tables away. You need a slightly different technique. The previous methods were for rolling up email addresses only one table away.
When rolling up information two tables away there are two options: rolling up a rollup, or rolling up a lookup. When rolling up the lookup, use
ARRAYFLATTEN(values) as your innermost function.
Lookup fields are the most difficult fields to work with. I avoid them when possible. However, when rolling up information from two tables away, it is sometimes necessary to use a lookup field in the middle table.
My solution is complicated because there’s 4 tables involved and so the potential recipient’s email ends up in 2 different fields in the final table that the email automation is referencing, but the short version is that Rollups worked for populating the emails and I then concatenated the two fields into one using a formula. I think I was getting the initial error because AT was choosing a record to test that had no email due to 2 different tables acting as sources for the 4th table.
Your recommendation to retest all triggers was part of the solution as well I believe.
Thanks for the help @kuovonne!