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.
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:
Please post here if this needs more explanation.
If this solves your problem, please post here.
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.
Here is the expression that I used in the initialize Variable action:
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:
@greaterOrEquals(formatDateTime(addHours(body('Get_file_metadata_using_path')?['LastModified'], 1), 'yyyy-MM-ddTHH:mm:ssZ'), utcNow('yyyy-MM-ddTHH:mm:ssZ'))
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!
(Flow Community Admin)
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
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.
We've updated and improved the layout and uploading format of the Power Automate Cookbook!
Fill out a quick form to claim your user group badge now!
We've given our badges an overhaul and also added some brand new ones!
Learn how to build the business apps that you need.
Find out where you can attend!
Watch & learn from the Power Automate Community Video Gallery!