cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TravisH
Regular Visitor

Multiple Notification Emails from Flow

Hi,

 

I have a flow that seems to be misbehaving, the flow is linked to a Sharepoint list which contains a list of documents, the name, the date issued, a URL for the document and so on. In my flow which runs at 17:05 each day, it gets the list of items from the SharePoint list, and looks to see if the valid from date is empty (if so it does nothing), it then uses the list of entries which have a date in the valid from entry and checks to see if the date it is valid from is the same date as today. If so it then sends an email and a message to a teams group to tell them a new document has been issued and they should read it and sign a document saying it has been read (our management of change process).

 

This works well, except for some reason it fires off multiple emails (which are the same) every time it is triggered. It is not that there are multiple items in the list that have the date as today, but rather it sends the same notification multiple times in the short window.

 

Can anyone help me try and work out what is going on with this?,

 

Many Thanks!

FlowError.jpg

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @TravisH ,

In my flow, I use the 'Filter array' to get the items which meet the condition 'valid from date' is equal to today.

Then use the Condition to check if the output of 'Filter array' is empty.

If yse, so there is no item meet the condition('valid from date' is equal to today.), do nothing.

If no, just send an email, don't need apply to each.

Best Regards,

Community Support Team _ Zhongys

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5

@TravisH 

Hi there!

 

I'm not 100% certain, but I think it's the "Apply to Each" that's messing with you.

 

Maybe try changing the "if Yes" action step to do something like set a variable to "Something changed" and then move the Teams and eMail bit outside of the Apply to Each.  And then you can use the variable as the body of the messages...or not.

 

Keep us posted.

 

-Ed-

v-zhos-msft
Solution Sage
Solution Sage

Hi @TravisH ,

It is because there are multiple items meet the condition.

For each item, it will send a email.

I suggest you use 'Filter array' here.

The expression in condition is :

empty(body('Filter_array')) is equal to true

Capture4.PNG

Best Regards,

Community Support Team _ Zhongys

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for the response, just to clarify with your example @v-zhos-msft ,am I right in thinking that the first filter array is looking through the list of items and then compiling an array of entries where the valid is equal to today (or presumably empty), then the next stage is going through that, and checking to see if it is empty and going from there.

 

Would the array be populated with empty entries if you are filtering it based on the document valid date?

Also, should the send an email be in an apply to each that references the body of the array. Reason I ask is that flow is automatically moving it to an Apply to each section

Hi @TravisH ,

In my flow, I use the 'Filter array' to get the items which meet the condition 'valid from date' is equal to today.

Then use the Condition to check if the output of 'Filter array' is empty.

If yse, so there is no item meet the condition('valid from date' is equal to today.), do nothing.

If no, just send an email, don't need apply to each.

Best Regards,

Community Support Team _ Zhongys

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.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

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.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Users online (2,989)