Skip to main content
Solved

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


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.

Best answer by Databaser

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.

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

View original
Did this topic help you find an answer to your question?

7 replies

Databaser
Forum|alt.badge.img+19
  • Inspiring
  • 866 replies
  • Answer
  • January 20, 2022

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.

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


  • Author
  • New Participant
  • 2 replies
  • January 21, 2022

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


Forum|alt.badge.img+8
  • Participating Frequently
  • 8 replies
  • January 21, 2022
Databaser wrote:

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.

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


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.


Databaser
Forum|alt.badge.img+19
  • Inspiring
  • 866 replies
  • January 22, 2022
Attaboy wrote:

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.


Forum|alt.badge.img+1

@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
Forum|alt.badge.img+19
  • Inspiring
  • 866 replies
  • December 23, 2022
Selman_Kaldirog wrote:

@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?


Forum|alt.badge.img+4
  • Known Participant
  • 13 replies
  • March 3, 2023

Reply