Jul 09, 2021 08:43 PM
Hi everyone,
I’m sure this is a common question but I didn’t find a neat solution.
We send weekly emails using AT Automation triggered by a schedule. This searches for new project created over the last 7 days and sends an email with the HTML grid view.
Occasionally there are no new projects and so it sends the email without any data. Is there a neat solution for this ?
Cheers
Jul 10, 2021 11:30 AM
There are a couple of options that come to mind.
One is to change to a “When record matches conditions” trigger, which will allow the trigger to only fire if the conditions are met. This typically means using a formula field to drive the trigger, and in your case, this would also mean designing the formula to not only check the schedule and projects, but also to only create the desired trigger output from a single record (otherwise it’ll trigger once for every record in the table). Probably not ideal in your case.
The other option that comes to mind is to divide and conquer. In your existing scheduled automation, run the Find records
action, but then the next step would be a script action, which would check the output of the Find records
action. If records are found, it would call a webhook automation; otherwise it would just end and do nothing.
The webhook automation would be a new automation that would only run if records were found from the scheduled automation. It only needs to contain the Send email
action containing your desired data.
That’s just a quick overview of the setup. If you need more specific help, just holler.
Jul 11, 2021 03:36 AM
Thanks Justin. That makes sense and the second option is probably viable. I will just have to work out the script part for finding records.