cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
EricKaye
Level: Power Up

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

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?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-zhos-msft
Level 10

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

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.

 

View solution in original post

3 REPLIES 3
Super User
Super User

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

@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.

 

 

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
EricKaye
Level: Power Up

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

@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! 

v-zhos-msft
Level 10

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

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.

 

View solution in original post

Helpful resources

Announcements
firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,920)