cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
keremtsc
Helper I
Helper I

Send Email Reminder if "Modified" date is older than 12 months

Hello,

 

I am trying to create a check for the last time a file in a Sharepoint was modified and if it is older than 12 months the owner of it gets a Email. 

I have managed to create a flow which checks >every< file & folder in the Sharepoint but that is not what I want. 

 

There are like 150 parent folders which all have a subfolder named "Reviewed Version" inside of them. 
I only want to check the files that are in this subfolder and for that I created a filter query:

 

pci1.0.jpg

 

But this filter only checks the folder named "Reviewed Version" but I want to check all the files inside of this folder.

 

And also my function for it to only send the files in Email where the "modified" date is older than 365 days doesn't work?

pic2.PNG

 

So two questiond:

1. How can I get the "Get files" connector to check the files INSIDE of the "Reviewed Version" folder?

2. How can I filter it to only send the files where the "last modified" date is older than 365 days?

 

Thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions
tom_riha
Super User
Super User

Hello @keremtsc ,

1. you're using FileLeafRef in the Filter Query, that's the file name, try to use FileRef instead, that's the server relative path to the file

2. add to the Filter Query another filter:

Modified lt 'addDays(utcNow(),-365)' 

Note: the addDays(...) is an expression

The connector between the filters will be just the word and:

substringof('Reviewed Version',FileRef) and Modified lt 'addDays(utcNow(),-365)' 

 



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

3 REPLIES 3
tom_riha
Super User
Super User

Hello @keremtsc ,

1. you're using FileLeafRef in the Filter Query, that's the file name, try to use FileRef instead, that's the server relative path to the file

2. add to the Filter Query another filter:

Modified lt 'addDays(utcNow(),-365)' 

Note: the addDays(...) is an expression

The connector between the filters will be just the word and:

substringof('Reviewed Version',FileRef) and Modified lt 'addDays(utcNow(),-365)' 

 



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

Hi @tom_riha thank you!

 

Is there a possibility to not check the folder itself as it still seems to do so?

Hello @keremtsc ,

you could try to exclude it in the Filter Query, but here I'm not 100% sure if it'll work.

substringof('Reviewed Version',FileRef) and Modified lt 'addDays(utcNow(),-365)' and FileLeafRef ne 'Reviewed Version'

 



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (3,333)