cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Titatovenaar
New Member

Only apply condition to every record of a filtered list

Hi guys,

 

I want to make sure my flow does not send the same e-mails twice.

In table 'List rows present in a table 2' the history of mails send is being updated. (MailSendID is the unique record here)

In table 'List rows present in a table' all unique mails are listed out that are ready to be send. (ID is the unique record here that potentially matches with MailSendID from the previous table).

 

I want to use the 'Filter Array' action to filter only rows from 'List rows present in a table' where MailSendID contains ID.

After the 'Filter Array', via add a condition I want to check how many rows were returned. If it's 0 = there wasn't any row where the MailSendID contains ID, meaning that the array is empty and an email can be send. If it's more than 0 then there's at least one row where column MailSendID contains ID. So I know I do not have to send the same mail again.

 

Maybe the problem is that the 'Filter Array' is within an 'Apply to each' action, but unfortunately it is impossible to do it without.

As soon as I use a Filter Array and compare 2 fields from different tables, it immediately places it within an 'Apply to each'.

 

 

Titatovenaar_0-1617390310287.png

 

Any suggestion is greatly appreciated!

 

1 REPLY 1
alrez
Community Support
Community Support

Hi,

 

Instead of doing the "send an email action" within the "apply to each" create a variable at the beginning  of the flow, then set the variable to either Yes or No within the "apply to each", then after the "apply to each" add a condition to check whether that variable is yes or no and send an email depending on whether its set to yes or no.

 

Regards,

 

Alex

 

-------

 

Community Support Team _ Alex Rezac
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (2,429)