Help

Welcome to the Airtable Community! If you're new here, check out our Getting Started area to get the most out of your community experience.

Don't Run Automation if Records Don't Exist?

Topic Labels: Automations
714 6
cancel
Showing results for 
Search instead for 
Did you mean: 

I have an automation that emails the count of records that match certain criteria.

This often results in emails that indicate there are 0 records for consideration.

I’d like to only fire this automation (or send the email) if there matched records are >0.

Is this possible using the new conditional automations, or via scripting?

Thanks,
Andy.

6 Replies 6

Hi @andy_democracy

You’re probably using a “find” action to return the number of records? You can put the “email action” in the “conditional actions” and configure to only send when the amount of found records is > 0.

image

Do keep in mind that every trigger (so not the actions) count towards your automation run limits.

Thank you. That’s exactly what I was looking for.

Would the automation not just fail if “find” found zero results? I’m having a heckuva time with cases where “find” is passed an empty field or when it finds zero results. In both cases, it appears to halt the automation (and email me every time to let me know) rather than proceed to an alternative “find” method. I read the documentation for “find” and found little help around its failure conditions.

No. The “find record” actions never fails. It’s the action after that that fails. That’s why you can put “find records” in the action box, but the other actions in the conditional action box (with condition “where find records length > 0”) + 1 more “otherwise” action (eg, “send email”).

That way, when records are found, your action will run. If no records are found, you’ll get an e-mail.

@Databaser this is incorrect. If you put "Find Records" in the Action, it will always run but if it doesn't find anything, the subsequent steps (conditional or not) won't run. The automation will fail and will send an email to the user stating that it failed to run. 

As far as I know, I couldn't find ANY way around this besides creating two separate automations:

  1. One with the Find record as action and continue as is (IF FOUND)
  2. One that checks for a condition (not based on find record but typically from the first automation's output to find the case of "IF NOT FOUND") and then continues. 

@Databaser this is incorrect. If you put "Find Records" in the Action, it will always run but if it doesn't find anything, the subsequent steps (conditional or not) won't run. The automation will fail and will send an email to the user stating that it failed to run. 

Isn't this exactly what I said?