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.

View solution in original post

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
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,456)