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

my flow works but no as I want it with onedrive

Hello,

 

This is my flow based on trigger "when a file is created" :

To resume : 

1 - when a new file is created 

2 - I get the name of the folder where the file is created

3 - I select all the row in my google sheets that have the same folder's name 

4 - I get the emails in relation between the folder and my google sheet 

5 - I waiting 10 min (it's to waiting if more files is upload in the same folder)

6 - I get the last files in this folder

7 - I create a html table with the name of each files

8 - I send an email with the email list retrieved in step 4 and with the new files added in my html table.

 

This flow works almost as I want it. But when I add multiple file in the 10 min delay (for example 3 files), I receive 3 time the same email.  

 

would you have an idea to solve my problem ?

 

best regards

allmyflow.JPG

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
jwhite
Level 8

Re: my flow works but no as I want it with onedrive

Hi @willy30870,

as RezaDorrani mentioned as the trigger for your flow is a file being created it will run every time you create a file.

The only solution that I can think of (although there is likely better out there) is to have a table or a list that tracks whether or not your flow is running.

I set up a flow using an excel table, but the same could be done with a sharepoint list or practically any other data storage.

The table is as simple as below:

FlowRunningTable.png

The "Running" column is just to check if our flow is running, and the "Key" column to identify it later in the flow.

Then before your steps in the flow I get the value of the running column and a condition for if the value of the running column is "No":

FlowRunningCondition.png

Then we leave the  If no branch of the flow empty as we don't want to do anything if it is. If it isn't running, we first set the "Running" column to "Yes", then have all the other steps of your flow:

FlowRunningRun.png

Finally at the end of this "If yes" branch we set the value of the "Running" column back to No:

FlowRunningReset.png

 

Which will then allow the If yes column to activate on the next flow run. Let me know if this helps!

 

Full flow and sharepoint equivalent in spoiler:

Spoiler
Full Excel Flow:
FlowRunningFullFlow.png
Sharepoint list:
FlowRunningSharepointList.png
Sharepoint Flow:
FlowRunningSP.png
2 REPLIES 2
RezaDorrani
Level 10

Re: my flow works but no as I want it with onedrive

Hi @willy30870 

 

Looks like you are triggering your flow when an item is created

Hence when you add more files, the flow gets triggered again

 

Regards,

Reza Dorrani

 

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

jwhite
Level 8

Re: my flow works but no as I want it with onedrive

Hi @willy30870,

as RezaDorrani mentioned as the trigger for your flow is a file being created it will run every time you create a file.

The only solution that I can think of (although there is likely better out there) is to have a table or a list that tracks whether or not your flow is running.

I set up a flow using an excel table, but the same could be done with a sharepoint list or practically any other data storage.

The table is as simple as below:

FlowRunningTable.png

The "Running" column is just to check if our flow is running, and the "Key" column to identify it later in the flow.

Then before your steps in the flow I get the value of the running column and a condition for if the value of the running column is "No":

FlowRunningCondition.png

Then we leave the  If no branch of the flow empty as we don't want to do anything if it is. If it isn't running, we first set the "Running" column to "Yes", then have all the other steps of your flow:

FlowRunningRun.png

Finally at the end of this "If yes" branch we set the value of the "Running" column back to No:

FlowRunningReset.png

 

Which will then allow the If yes column to activate on the next flow run. Let me know if this helps!

 

Full flow and sharepoint equivalent in spoiler:

Spoiler
Full Excel Flow:
FlowRunningFullFlow.png
Sharepoint list:
FlowRunningSharepointList.png
Sharepoint Flow:
FlowRunningSP.png

Helpful resources

Announcements
firstImage

Microsoft Flow Online Conference

Join us for a FULL day of FREE Microsoft Flow Sessions from some of the best minds in the industry!

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

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

thirdImage

New Flow Community Board!

Check out the new Microsoft Flow Community Blog Topic Suggestion board!

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 Flow Community Video Gallery!

Users Online
Currently online: 181 members 5,347 guests
Please welcome our newest community members: