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.
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
Solved! Go to Solution.
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
Hope this helps
Proud to be a Flownaut!
@PremierD please could you share an screanshot?
Proud to be a Flownaut!
Hi!
No need to apologize. Please share a screenshot from your current flow design
Thanx!
Proud to be a Flownaut!
Hi Christian, Thanks for the reply and absolutely
These are what I have tried so far.
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!
Proud to be a Flownaut!
Hi,
The 2 previous flows are me trying to achieve the result, both doing the same thing ....poorly 🙂
Hope that helps, again any help greatly appreciated.
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!
Proud to be a Flownaut!
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 🙂
Something like this is what I am trying to achieve, but I am not sure on the exact above steps.
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
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!
Proud to be a Flownaut!
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
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
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!
Proud to be a Flownaut!
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
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
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
Hope this helps
Proud to be a Flownaut!
Hi,
I tried to follow along, but I am getting an error
Using the syntax addDays(startOfDay(uctNow()),-7,'yyyy-MM-dd')
Getting closer 🙂
Thanks
utcNow
you typed uctNow instead 😅
Proud to be a Flownaut!
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
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
Thanks
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
Hope this helps
Proud to be a Flownaut!
Not sure if anyone can help - i don't know if the actions for this flow has changed but i cannot see the actions mentioned in this post and can only see things for Lists and not changes to folders 😞
Im trying to do a similar scenario of a regular email detailing changes made to documents or files held in a SharePoint folder. I noticed in sharepoint you can directly set up alerts however this needs to go to a distribution list with extra information.
Background: this is a sharepoint folder with training material so we want to advise users if a new document is available or if a document has been amended so i can add a link to the document for them to look at.
Any help would be appreciated