cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
thewiteam
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
v-xida-msft
Community Support
Community Support

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
v-xida-msft
Community Support
Community Support

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.

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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (2,044)