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

Building a flow that sends an email once a day with a list of new items added to onedrive folder

I want to create a flow that can send an email once each day with a list in the body of the email of the names of all the new documents added to a onedrive folder since the last time the flow ran. Is it possible to create a flow like this?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Building a flow that sends an email once a day with a list of new items added to onedrive folder

Hi @thewiteam,

 

Do you want to get the names of all the new documents added to a OneDrive folder since the last time the flow run?

 

If you want to get the names of all the new documents added to a OneDrive folder since the last time the flow run, I afraid that there is no way to achieve your needs in Microsoft Flow currently. There is no way to get the last time the flow ran in Microsoft Flow currently.

 

If you added new files into your OneDrive folder in current day and you don't modify these new added files, you could consider take a try with the following workaround:

  • Add a "Recurrence" trigger, interval set to 1 and Frequency set to Day.
  • Add a "List files in folder" action, specify Folder and Include subfolders set to Yes.
  • Add a "Filter array" action, From set to output of the "List files in folder" action, click "Edit in advanced mode", type the following formula:

 

@equals(formatDateTime(item()?['LastModified'], 'MM/dd/yyyy'), utcNow('MM/dd/yyyy'))

 

  • Add a "Select" action, From set to output of the "Filter array" action, within Map entry, type two entries. The Key of first entry set to File Name and the corresponding value set to Display name dynamic content of the "Filter array" action. The Key of second entry set to Created Time and the corresponding value set to Last modified time dynamic content of the "Filter array" action.
  • Add a "Create HTML table" action, From set to output of the "Select" action, Include headers set to Yes.
  • Add a "Send an email" action, Body field set to output of the "Create HTML table" action, Is HTML field set to Yes.

Image reference:3.JPG

 

4.JPG

The flow works successfully as below:5.JPG

 

6.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.

View solution in original post

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: Building a flow that sends an email once a day with a list of new items added to onedrive folder

Hi @thewiteam,

 

Do you want to get the names of all the new documents added to a OneDrive folder since the last time the flow run?

 

If you want to get the names of all the new documents added to a OneDrive folder since the last time the flow run, I afraid that there is no way to achieve your needs in Microsoft Flow currently. There is no way to get the last time the flow ran in Microsoft Flow currently.

 

If you added new files into your OneDrive folder in current day and you don't modify these new added files, you could consider take a try with the following workaround:

  • Add a "Recurrence" trigger, interval set to 1 and Frequency set to Day.
  • Add a "List files in folder" action, specify Folder and Include subfolders set to Yes.
  • Add a "Filter array" action, From set to output of the "List files in folder" action, click "Edit in advanced mode", type the following formula:

 

@equals(formatDateTime(item()?['LastModified'], 'MM/dd/yyyy'), utcNow('MM/dd/yyyy'))

 

  • Add a "Select" action, From set to output of the "Filter array" action, within Map entry, type two entries. The Key of first entry set to File Name and the corresponding value set to Display name dynamic content of the "Filter array" action. The Key of second entry set to Created Time and the corresponding value set to Last modified time dynamic content of the "Filter array" action.
  • Add a "Create HTML table" action, From set to output of the "Select" action, Include headers set to Yes.
  • Add a "Send an email" action, Body field set to output of the "Create HTML table" action, Is HTML field set to Yes.

Image reference:3.JPG

 

4.JPG

The flow works successfully as below:5.JPG

 

6.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.

View solution in original post

Highlighted
New Member

Re: Building a flow that sends an email once a day with a list of new items added to onedrive folder

I tried this flow. On the third step, Filter array, the only From that came up was onedrive value. Using this I got an email but no list of files. All else was input exactly as shown with the exception of the second step, where I entered the directory but got no dropdown for including subfolders.  Why won't the filter array comman give me the option of onedrive body

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

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
Users online (5,793)