Help

Send email only if records found on a "repeat for each" action loop

Topic Labels: Automations
Solved
Jump to Solution
473 3
cancel
Showing results for 
Search instead for 
Did you mean: 
Allan-Cohen
5 - Automation Enthusiast
5 - Automation Enthusiast

Hello,

I am building a project management tool and want to send daily messages to the users on late tasks, upcoming etc...

to do so, I have created my automation as follow:

AllanCohen_0-1727947722606.png

 

The idea is to run automation everyday, look for all users from a table 'participants', and for each one of them search for late tasks assigned to them. Generate an email and send it to each recipient. (I don't want to generate 1 email per late task.... too many messages)

This works great as is, except that if there is nothing late in the queue for a user, he will still get an email with an empty table...

anybody has a solution to add a condition on this automation?

thanks!

1 Solution

Accepted Solutions
FarioConsulting
6 - Interface Innovator
6 - Interface Innovator

Hi Allan,

You could add a script action after the "Find records" step to check if any records were found. If no records are found, you can then stop the automation and prevent an empty email from being sent.

See Solution in Thread

3 Replies 3
Allan-Cohen
5 - Automation Enthusiast
5 - Automation Enthusiast

well... sometimes writing down gives ideas....

so that everyone gets at least ONE solution for this kind of issue...

 

I have added a lookup field on my tasks with limitations as follow:

-is late (due date past current date)

-is not done (status <> done)

 

2/ I created a filtered view that only displays items where this lookup is not empty

 

I limit my first action (list all users) to this new filtered view.

FarioConsulting
6 - Interface Innovator
6 - Interface Innovator

Hi Allan,

You could add a script action after the "Find records" step to check if any records were found. If no records are found, you can then stop the automation and prevent an empty email from being sent.

Allan-Cohen
5 - Automation Enthusiast
5 - Automation Enthusiast

Thanks FarioConsulting.

I will mark your message as the "clean" solution, even if mine worked as well.

I consider adding as little as possible columns for technical use, if doable by script, is better -> you win 🙂