cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Weekly report send by Email with SharePoint folder changes

Hi PA Community,

My first time posting and very new to PA. I am trying to create a flow that will send a weekly email with changes to files within a folder in a document library. I have managed to get a flow created that sends an email with changes in the folder and sub folders / files, but is bombarding with emails.

 

I have had assistance from MS with a flow, but it does not work, so I am really baffled.

 

So in my sharepoint site https://sharepoint/site/mysite I have a folder (MyFolder) with folders and files in it.  If any changes happen over a 7 day period to send an email with the path / details in an email. I have tried the recurrence trigger with variables etc, but no joy. Apologies if this question has been asked already.

 

https://powerusers.microsoft.com/t5/Building-Flows/Weekly-summary-email-of-all-new-and-modified-list...

 

I have tried to follow this, but it's not entirely clear, but I think this is what I am after but in a folder.  Many thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Dual Super User III
Dual Super User III

Re: Weekly report send by Email with SharePoint folder changes

Hi!

"So I managed to crack it and I now have my email with list of documents created or modified in the last 7 days."

Congrats! It works!

 

"If possible I would like this to be DD/MM/YYYY and UK London time. Is this possible?"

I believe so...

... since you are working with an array of elements, you would need to apply the change either via your 'Select' action block'

So on your mapping table, in the row with Name 'Modified', my suggestion is to replace current assigned value and add the a expression to change date time zone + format instead

 

convertTimeZone(item()?['Modified'],'<current time zone>','<new time zone>','f')

 

Just replace <current time zone>, <new time zone> with the desired ones from this list:

https://support.microsoft.com/en-us/help/973627/microsoft-time-zone-index-values

 

More information here

https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#c...

Hope this helps

 

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

18 REPLIES 18
Highlighted
Super User III
Super User III

Re: Weekly report send by Email with SharePoint folder changes

@PremierD  please could you share an screanshot?



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
Highlighted
Dual Super User III
Dual Super User III

Re: Weekly report send by Email with SharePoint folder changes

Hi!

No need to apologize. Please share a screenshot from your current flow design

Thanx!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted
Helper II
Helper II

Re: Weekly report send by Email with SharePoint folder changes

Hi Christian, Thanks for the reply and absolutely

 

flow_1.pngflow_2.png

 

These are what I have tried so far. 

Highlighted
Dual Super User III
Dual Super User III

Re: Weekly report send by Email with SharePoint folder changes

Hi!

Please expand all action blocks from your flow design , just need to deoubleckick on each of them, and share again a screenshot.

It also looks like you have two different flows, right? Are they two alternate designs for the same challenge?

Thanx!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted
Helper II
Helper II

Re: Weekly report send by Email with SharePoint folder changes

Hi,

 

The 2 previous flows are me trying to achieve the result, both doing the same thing ....poorly 🙂

Flow.png

 

Hope that helps, again any help greatly appreciated.

Highlighted
Dual Super User III
Dual Super User III

Re: Weekly report send by Email with SharePoint folder changes

Hi!

The reason you are getting ton of emails is the 'Send an email' is iside an 'Apply to each'... you need to move it outside.

Probably 'Apply to each' was automatically added by the editor once you tried to add a field from your SP list...

So the question is... which data do you expect to add to your single email body? Is it enough with an HTML table with 'fullpath' from each file matching your condition?

 

I would actually remove all your 'apply to each', just after 'Get items' add a Select action block, assign as its input 'Get items' output, and add a single pair to the mapping table:

name -> Fullpath

value -> assign 'fullpath' dynamic content

 

Just after Select, add a Create HTML table, assign as its input 'Select' output

Finally add 'SEnd an email', assign as body 'Create HTML' table

Thanx!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted
Helper II
Helper II

Re: Weekly report send by Email with SharePoint folder changes

HI,

I think I may have explained myself poorly. I am not getting multiple emails now. I had a simple flow that sent an email when files or folders were modified and it worked perfectly, but it had no schedule and was just running , so everytime there was a change an email was sent, this became a bit annoying.

 

The flow I have here worked but was producing an empty output, and I cannot understand why.  Would you be able to offer a step by step guide?  Cheeky to ask I know, I will also keep trying as well. Thanks

 

Stay safe 🙂

Highlighted
Helper II
Helper II

Re: Weekly report send by Email with SharePoint folder changes

Something like this is what I am trying to achieve, but I am not sure on the exact above steps.

2020-03-27 12_06_59-Solved_ Weekly summary email of all new and modified list ... - Power Platform C.png

 

I tried to create it and also use the expression mentioned in the post , but it does not like it

 

@and(not(equals(item()?['Status']?['Value'], 'Current')), or(greaterOrEquals(formatDateTime(item()?['Created'], 'MM/dd/yyyy'), formatDateTime(addDays(utcNow(), -7), 'MM/dd/yyyy')), greaterOrEquals(formatDateTime(item()?['Modified'], 'MM/dd/yyyy'), formatDateTime(addDays(utcNow(), -7), 'MM/dd/yyyy'))))

Thanks

 

Highlighted
Dual Super User III
Dual Super User III

Re: Weekly report send by Email with SharePoint folder changes

So... what's the challenge now?

do you need a flow to be executed everyday that lists the files modified the day before, then send the list via email?

Thanx!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted
Helper II
Helper II

Re: Weekly report send by Email with SharePoint folder changes

I want to get a list of files from the last 7 days that have been created or modified in the One sharepoint (shared documents folder \foldername) and then send an email on a Monday morning with the attached list. Here is what I have now created and it works, but I am getting loads of emails and duplicates 

2020-03-27 12_34_43-Microsoft Edge.png

 

email duplicate.png

 

I am just trying to get a single email that lists the last 7 days changes with Modified by (name) when and file path.

 

Sorry for all the questions

 

Thanks

Highlighted
Dual Super User III
Dual Super User III

Re: Weekly report send by Email with SharePoint folder changes

No problema!

We are closer to a happy ending!

So the challenge now is to move 'Create HTML table' and 'Send an email' out of the Apply to each.

Give me some minutes

Thanx!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted
Helper II
Helper II

Re: Weekly report send by Email with SharePoint folder changes

So, I have sorted the duplicate emails and I am now getting the correct list, this only thing that is broken is the 'Modified' part, instead of just from the last 7 days, it is pulling back from last year 2019 

new _flow.pngnewemaail.png

 

So If I can just crack the modified in the last 7 days, then it's done 🙂

 

@And(not(equals(item()?['Status']?['Value'], 'Current')), or(greaterOrEquals(formatDateTime(item()?['Created'], 'yyyy/MM/dd'), formatDateTime(addDays(utcNow(), -7), 'yyyy/MM/dd')), greaterOrEquals(formatDateTime(item()?['Modified'], 'yyyy/MM/dd'), formatDateTime(addDays(utcNow(), -7), 'yyyy/MM/dd'))))

 

That is the expression / formula that is being used, it's just not working quite right.

 

Thanks

Highlighted
Dual Super User III
Dual Super User III

Re: Weekly report send by Email with SharePoint folder changes

Hi again!

Let's forget about the 'Filter array'... Odata filter inside 'Get items' is gonna be faster to implement.

When adding the Odataexpression in 'Filter query' please make sure single quotes are wrapping your variable

 

Flow_DateTimeRangeFilterFiles.png

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted
Helper II
Helper II

Re: Weekly report send by Email with SharePoint folder changes

Hi,

I tried to follow along, but I am getting an error 

error1.png

 

Using the syntax addDays(startOfDay(uctNow()),-7,'yyyy-MM-dd')

 

Getting closer 🙂 

Thanks

Highlighted
Dual Super User III
Dual Super User III

Re: Weekly report send by Email with SharePoint folder changes

utcNow

 

you typed uctNow instead 😅

 

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted
Helper II
Helper II

Re: Weekly report send by Email with SharePoint folder changes

Hi,

Thanks for pointing that out, I amended my typo 🙂 , but now I get no results returned, which is odd as I know files have been changed / modified in the last 7 days.

 

Any ideas ? Thanks again

Highlighted
Helper II
Helper II

Re: Weekly report send by Email with SharePoint folder changes

Hey,

me again 🙂 So I managed to crack it and I now have my email with list of documents created or modified in the last 7 days. Now I have my final issue. I am trying to change the 'formatDateTime' to change the current output

Modified

2020-03-26T08:19:07Z

 

If possible I would like this to be DD/MM/YYYY and UK London time. Is this possible?

 

I am trying a convert time in my flow, but does not seem to be working

 

datetime.png

 

Thanks

Highlighted
Dual Super User III
Dual Super User III

Re: Weekly report send by Email with SharePoint folder changes

Hi!

"So I managed to crack it and I now have my email with list of documents created or modified in the last 7 days."

Congrats! It works!

 

"If possible I would like this to be DD/MM/YYYY and UK London time. Is this possible?"

I believe so...

... since you are working with an array of elements, you would need to apply the change either via your 'Select' action block'

So on your mapping table, in the row with Name 'Modified', my suggestion is to replace current assigned value and add the a expression to change date time zone + format instead

 

convertTimeZone(item()?['Modified'],'<current time zone>','<new time zone>','f')

 

Just replace <current time zone>, <new time zone> with the desired ones from this list:

https://support.microsoft.com/en-us/help/973627/microsoft-time-zone-index-values

 

More information here

https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#c...

Hope this helps

 

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

FirstImage

Microsoft Ignite 2020

Check out the announcement of Power Platform content at Microsoft Ignite!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,163)