cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
EricKaye
New Member

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 Solution Sage
Solution Sage

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

5 REPLIES 5
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
New Member

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 Solution Sage
Solution Sage

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

PaulDerby
Frequent Visitor

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 

 

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

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

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

 

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

Scott

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

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!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (7,103)