cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Upload and edit a file, send email with file, update file after sending. E-mail sent multiple times

Hello everybody , 

 

i created a flow with following purpose , 

a file is uploaded to a document library , and the user adjusts the file.  ( a delay is configured so the user has time to adjust the file, before the next step in Flow starts ) 

When the user has adjusted the file and the delay is expired, a next step is added to get the file, and get the file properties. 

Some of the files that have been added need to be send by e-mail, others not. I've created a query filter to select the ones that need to be e-mailed in the next step. 

In the library i've also added a column ' e-mail ' which is default set to no , and after sending the e-mail updated to yes. On this value is also filtered (  email equals no )

flow will create an e-mail with the file in attachment. 

e-mail is sent, and value for email is updated from no to yes. 

 

Now this works fine if 1 file is added.

If multiple files are added, within the time frame of the delay, the e-mails & attachments get mixed up, and each e-mail is send out multiple times ( per added file 1 time, so if I ad 3 files with the time frame , each mail is sent out 3 times = 9 e-mails with mixed up attachments .) 

 

How can I configure the set up that each mail is unique and sent out separately ? 

Flow_2.png

Thx!!

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Re: Upload and edit a file, send email with file, update file after sending. E-mail sent multiple times

Hi @JJanssens ,

 

You could refer to screenshot below to create the flow:

1.png

And please check the column type if the e-mail column, if it is a Yes/No type column, please compare the column with true or false, if it is a single line of text column, you could just compare it with the value in it.

 

Best Regards,

Alice

 

Community Support Team _ Alice Zhang
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
Highlighted
Community Support
Community Support

Re: Upload and edit a file, send email with file, update file after sending. E-mail sent multiple times

Hi @JJanssens ,

 

Do you want to send an email for each new created file?

Please refer to screenshot below to create the flow:

1.png

 

Best regards,

Alice   

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

Highlighted
Frequent Visitor

Re: Upload and edit a file, send email with file, update file after sending. E-mail sent multiple times

Hello Alice,

 

Not for each new created file ,

in my flow i've added an extra step ' Get File Properties ' , in which I filter on certain values. 

For example , there is a column in the library that defines the type of document. This selection is made by the user who uploads the file. 

Uploaded File ' A ' , user sets as type ' Manual ' 

Uploaded File ' B ' , user sets as type ' Invoice ' 

 

The filter in the step " get properties " is set to ' Type eq Manual and E-mail eq No '  

 

After sending out the email with the 'Manual' , the e-mail value is updated to Yes so this doens't match the filter when a next file is uploaded.  The file invoice will not be send since this doenst match the type filter. 

 

Kind regards,

 

Jan. 

Highlighted
Super User II
Super User II

Re: Upload and edit a file, send email with file, update file after sending. E-mail sent multiple times

Hello @JJanssens 

This will never work! You will always have a conflict between files being uploaded and files being taken for sending by email. Every file that is uploaded will trigger your flow and try to get the same files, those with No in Email! To complicated, simplify it!

 

To simplify it - create another list - "Newly uploaded files" - and use that one to indicate that a file needs to be processed.

Your flow will only register an item in the list "Newly uploaded files" (with appropriate properties so the file can be identified).

Create a recurrent flow that runs every 5-10 min. and takes all items from the list "Newly uploaded files" (to allow your users to finish manipulating their original files, a filter query can be used to take only items created 10 min. before and is marked as processed).

The recurrent flow then sends out the email with all the information about the newly uploaded files. Lastly it updates the same items from the list "Newly uploaded files", marking them as processed - so that you don't process them again! 🙂

 

Just a suggestion, hope this helps you on the way.

Kind regards, John

Community Support
Community Support

Re: Upload and edit a file, send email with file, update file after sending. E-mail sent multiple times

Hi @JJanssens ,

 

You could refer to screenshot below to create the flow:

1.png

And please check the column type if the e-mail column, if it is a Yes/No type column, please compare the column with true or false, if it is a single line of text column, you could just compare it with the value in it.

 

Best Regards,

Alice

 

Community Support Team _ Alice Zhang
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

Highlighted
Frequent Visitor

Re: Upload and edit a file, send email with file, update file after sending. E-mail sent multiple times

Thanks all for the replies 🙂

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

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!

Top Solution Authors
Top Kudoed Authors
Users online (4,430)