cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TravisH
Level: Powered On

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
v-zhos-msft
Level 10

Re: Multiple Notification Emails from Flow

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
Super User
Super User

Re: Multiple Notification Emails from Flow

@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
Level 10

Re: Multiple Notification Emails from Flow

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.

TravisH
Level: Powered On

Re: Multiple Notification Emails from Flow

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?

TravisH
Level: Powered On

Re: Multiple Notification Emails from Flow

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

v-zhos-msft
Level 10

Re: Multiple Notification Emails from Flow

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

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Speakers, submit your sessions now! Call for speakers ends Feb. 10!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Users online (5,009)