web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Trying to make a flow ...
Power Automate
Answered

Trying to make a flow to send a document for review from Sharepoint if it hasn't been modified in a certain time period

(0) ShareShare
ReportReport
Posted on by 8

I am trying to create a flow for our standard operating procedures on SharePoint to automatically send for review and approval when they have not been modified in a year. I have started the automated flow with the "When a file is created or modified" in Sharepoint and wanted to add a condition based on the modified field but I am unsure how to set the condition up. Can anyone help me with this?

 

 

Categories:
I have the same question (0)
  • ScottShearer Profile Picture
    25,270 Most Valuable Professional on at

    @EricKaye 

    I believe you should start with a recurrence trigger rather than a Created or Modified trigger. A Flow can only be running for 30 days and then it will be cancelled.

     

    Schedule the Flow to run periodically (Daily? Weekly?) and use a Get Files (properties only) action.  In that action, configure a filter query that will filter out any documents that have not been modified in over a year.

    I haven't tested this, but the filter query should look something like this:

    Modified le 'addDays(utcNow(),365,'yyyy-MM-dd')'

     

    The text inside of the single quotes is an expression and must be entered in the expression window.  The single quotes are required.

     

    The problem is that if you loop through the list and start approvals, the Flow will pause on each individual approval until action is taken.  You might want to create an entry in a separate list for each item.  Then start an approval on the items in the new list.  The items in the new list can be linked to the original document.....  There are other ways of approaching this as well.

     

     

     

     

  • EricKaye Profile Picture
    8 on at

    @ScottShearer 

     

    Thanks for quick response to my question! You may have to bear with me on this as this is my first time using Flow and I am trying to understand the logic behind it. 

     

    I have started creating a reoccuring flow like you suggested with your comment, finished adding the query you suggested but I am lost after that. Should I look into sending an email / approval request to the approver of the document and have that automatically updated the SharePoint document workflow status?

     

    I am also interested in the other ways that this could be done. 

     

    Thanks again for all your help! 

  • Verified answer
    v-zhos-msft Profile Picture
    on at

    Hi @EricKaye ,

    It seems you want to check whether the document has been modified in one year.

    If the document hasn't been modified in one year, you want to send the document for review.

    I have made a test on my side, please take a try with the following workaround:

    Here I use the 'Recurrence' trigger, it will run one time every month to check the document.

    The expression in the codition is:

    addDays(items('Apply_to_each')?['Modified'],365,'yyyy-MM-dd')
    is less than 
    utcNow('yyyy-MM-dd')

    Capture6.PNG

    Best Regards,

    Community Support Team _ Zhongys

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

  • PaulDerby Profile Picture
    6 on at

    @ScottShearer 

     

    Hi Scott - 

     

    Created a very similar FLOW to the one outlined here and it's working well - just looking for input to improve it by one step and struggling somewhat when it comes to the Array piece - (maybe method other than an Array will work?) 

     

    Flow analyses Doc Library Review Date - compares to current date(TODAY) and if condition (Less Than or Equal ) is met, will fire off an automated email advising that there is a Document due for review.

    This is a "one e-mail per document", but one of the Libraries in the scope of this FLOW has 1600 docs in it with about 15 authors- so was hoping to add all docs due for a review by each Document Owner to a single e-mail rather than killing their inbox with dozens of emails.

     

    I tried to create an Array to include the Docs for review by Owner but the output only seems to copy each document into an array with the same number of identical entries ( the number of entries matches the number of individual docs, so I know I'm close, just not sure if i'm positioning the Array properly in the Apply-to-Each module) - Basic flow is below - can you advise where to put the array and how to reference/call it in the email body ( the Output of the Array didn't appear in the Dynamic Content ) 

    DocReview.PNG

     

    Regards,

    Paul

  • ScottShearer Profile Picture
    25,270 Most Valuable Professional on at

    @PaulDerby 

    Here is a link to a post on this site that details how to accomplish your goal.  The solution uses a list but it would be the same concept for a library.

     

  • Community Power Platform Member Profile Picture
    on at

    Great Thread. Where I am getting stuck is when I get call Get Files "Properties Only" for a sharepoint folder which has 2 excel files, when I see the output it seems blank. So when the condition kicks in, it does not give me error and also does not have any email sent. Does anyone know why value is blank

     

    Capture2.JPG

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard