cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pws-nks
Level: Power Up

How to create flow When OneDrive edit send notify only once time

 

Hi,

 

I'm new to flow and I'm trying to get a file update notification(Excel File) on mail.

So I sat flow as follows:

1. Trigger - OneDrive - "When modified File" - Target Folder

2. Action - OneDrive - Create Share Link - Target File ID

3. Action - Gmail - "Send Email"

 

But that trigger detect every character edit on Excel.

So I've received 10 mail though I just edited a little bit!

 

As my own hope, 

I'd like to send email on edit action, some latitude in editing time as like 60min.

The simplest way to do this, trigger on every 60 min. check file same it as ever was, if it changed detected, send email.

But there is not trigger of schedule only action.

 

So, what I should do to receive notify after some editing, not every editing?

 

Thank you in advance for any help.

 
7 REPLIES 7
Super User
Super User

Re: How to create flow When OneDrive edit send notify only once time

Try this.....

 

Below is a screen shot of a Flow designed to be run once an hour (it ran successfully for me).

 

When the flow starts, I subtract 1 hour from the current time.and store it in a string variable

Then I get the file metatdata

After that, I compare the modified time to the time stored in the variable.

If the file has been modified in the last hour, an email is sent.

 

Yo'll need to edit the condition in advanced mode - here is the formula I used:

@greaterOrEquals(body('Get_file_metadata_using_path')?['LastModified'], variables('OneHourAgo'))

 

Please post here if this needs more explanation.  

If this solves your problem, please post here.

 

SendEmailOnFileChange1.jpg

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
pws-nks
Level: Power Up

Re: How to create flow When OneDrive edit send notify only once time

Thanks to reply, ScottShearer!

 

But I can't set "Action - Initialize Variable" because I couldn't see cleary your screenshot...

Would you post configration about "Initialize Variable" in text ?

(Especially, "Expression" section)

I'm sorry to cause you trouble.

Highlighted
Super User
Super User

Re: How to create flow When OneDrive edit send notify only once time

Here is the expression that I used in the initialize Variable action:

 

subtractFromTime(utcNow(),1,'Hour')
 
Recur.jpg
 
Just ask if you need more help.
 
Scott
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
Community Support Team
Community Support Team

Re: How to create flow When OneDrive edit send notify only once time

Hi @pws-nks,

 

I agree with @ScottShearer's thought almost, I assume that you want to check if the Excel file is changed in the last 1 hour, if yes, send the email notification.

 

You could also take a try with the following workaround:

  • Add a Recurrence trigger, Interval set to 1 and Frequency set to Hour. 
  • Add a "Get file metadata using path" action, specify File Path.
  • Add a Condition, click "Edit in advanced mode", type the following formula:
@greaterOrEquals(formatDateTime(addHours(body('Get_file_metadata_using_path')?['LastModified'], 1), 'yyyy-MM-ddTHH:mm:ssZ'), utcNow('yyyy-MM-ddTHH:mm:ssZ'))
  • Within "If/yes" branch of Condition, add a "Send an email" action.

Image reference:28.JPG

 

 

 

Best regards,

Kris

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

Re: How to create flow When OneDrive edit send notify only once time

Hello, @pws-nks!

 

Have you had a chance to apply @v-xida-msft ‘s recommendation to adapt your Flow? If yes, and you find that solution to be satisfactory, please go ahead and click “Accept as Solution” so that this thread will be marked for other users to easily identify!

 

 

Thank you for being an active member of the Flow Community!

 

-Gabriel

(Flow Community Admin)

-Gabriel
Microsoft Power Automate Community Manager
Are YOU a member of your local Power Automate User Group?
Fill out This Form to claim your Community User Group Member Badge!
CM123
Level: Power Up

Re: How to create flow When OneDrive edit send notify only once time

I know this is a bit of an old thread now, but is there a way to do this for a whole folder rather than having to edit in each file?

 

I have a folder which I update each week with a new file and don't want to have to create a new flow for all of them

Super User
Super User

Re: How to create flow When OneDrive edit send notify only once time

@CM123:

 

You could change the examples above a bit by using one of the OneDrive for Business list or Find files actions and loop through each one.  The Flow would still run using a recurrence trigger.

 

Scott

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

Helpful resources

Announcements
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!

Top Kudoed Authors
Users Online
Currently online: 92 members 5,279 guests
Please welcome our newest community members: