cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Flow - Filter SharePoint list based; older than 60 days

Hello, 

I am new to Flow. I am wanting to create a flow that after 60 days will move the list to an archive folder and delete. 

I am open to anything sugguestions at this point this is what I have tried so far. 

I am wanting to archive a SharePoint List after 60 days based on the column called "Last Day of Month" or Date (either is sufficent)

I am getting errors after errors. 

 

 

The error is 

The expression " 2019-07-02le'05-04-2019'" is not valid.
clientRequestId: c68ac8fe-1887-45b0-884c-a3e027ec205b
serviceRequestId: c68ac8fe-1887-45b0-884c-a3e027ec205b

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Flow - Filter SharePoint list based; older than 60 days

Hi  @kederose ,

 

Thanks for your reply.

 

Please see the below flow steps.

 

Here I used the created date of the list record.

 

First find todays date and formatted to yyyyMMdd format.

 

 

d11.png

d12.png

 

d13.png

 


The expression I used is

 

formatDateTime(adddays(items('Apply_to_each')?['Created'],60),'yyyyMMdd')

 

I am sure we could use all in one condition instead of the variables but the flow run details under the if condition expression will show only true or false not the values which compared and difficult for debugging purpose. Hence I used the variable here. 

 

I did tested the flow and it did worked as expected.

 

Let me know the results.

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

 

Thanks

 

 

 

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Power Automate Video Tutorials

View solution in original post

Highlighted
Super User III
Super User III

Re: Flow - Filter SharePoint list based; older than 60 days

Hi @kederose ,

 

Please see below flow steps under the Yes condition. Before you start creating the flow step create a new list with same metadata. Below I have created a list called 'aj'.  In flow step create item we can map the values from old list record. Once the record is mapped then add a new step called delete item list record and map the id from the old list.

 

d14.png

 

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

 

Thanks

 

 

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Power Automate Video Tutorials

View solution in original post

9 REPLIES 9
Highlighted
Regular Visitor

Re: Flow - Filter SharePoint list based; older than 60 days

 

@LastDayofMonth ‘addDays(utcNow(),-60,’yyyy-MM-dd’)’ is the code, I have been trying to use. 

Highlighted
Super User III
Super User III

Re: Flow - Filter SharePoint list based; older than 60 days

Hi @kederose ,

 

Are you trying to find the SharePoint list records older than 60 days?

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Power Automate Video Tutorials
Highlighted
Regular Visitor

Re: Flow - Filter SharePoint list based; older than 60 days

Yes, if the list item is past 60 days, I need to copy(but not an option for me) the list to my archive list folder and delete.
Highlighted
Super User III
Super User III

Re: Flow - Filter SharePoint list based; older than 60 days

Hi  @kederose ,

 

Thanks for your reply.

 

Please see the below flow steps.

 

Here I used the created date of the list record.

 

First find todays date and formatted to yyyyMMdd format.

 

 

d11.png

d12.png

 

d13.png

 


The expression I used is

 

formatDateTime(adddays(items('Apply_to_each')?['Created'],60),'yyyyMMdd')

 

I am sure we could use all in one condition instead of the variables but the flow run details under the if condition expression will show only true or false not the values which compared and difficult for debugging purpose. Hence I used the variable here. 

 

I did tested the flow and it did worked as expected.

 

Let me know the results.

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

 

Thanks

 

 

 

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Power Automate Video Tutorials

View solution in original post

Highlighted
Regular Visitor

Re: Flow - Filter SharePoint list based; older than 60 days

Thank you so much.I got everything from the images below to work. Can you tell me now how to get  the list items copy/create/move the item that is past the 60 days into another folder and delete from the original list, much like an archive feature?  That is my last task, I am needing. Thank you again for your help so far. 

Highlighted
Super User III
Super User III

Re: Flow - Filter SharePoint list based; older than 60 days

Hi @kederose ,

 

Please see below flow steps under the Yes condition. Before you start creating the flow step create a new list with same metadata. Below I have created a list called 'aj'.  In flow step create item we can map the values from old list record. Once the record is mapped then add a new step called delete item list record and map the id from the old list.

 

d14.png

 

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

 

Thanks

 

 

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Power Automate Video Tutorials

View solution in original post

Highlighted
Regular Visitor

Re: Flow - Filter SharePoint list based; older than 60 days

 

 

 

 

Hello Again, 

I tried your steps above. I created the new list created from the old list as template. 

I could "Title" as option to pull from the dynamic content options. I picked a couple from the list. The flow says it ran successfully, but nothing has been moved or created and I looked a little deeper and found this error. Any ideas what I should do now? 

Thank you again for your help!

 

 

second part error.jpg

Highlighted
Super User III
Super User III

Re: Flow - Filter SharePoint list based; older than 60 days

Hi @kederose ,

 

It's difficult to analyse from the screenshot you had given.  How many records you expecting to satisfy the yes condition. You need to click the next record for each from your run log foreach. I would say it's your data is not right which is not going through the Yes condition.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Power Automate Video Tutorials
Highlighted
Regular Visitor

Re: Flow - Filter SharePoint list based; older than 60 days

Thank you for your help! I unhid the title column and changed one of the expressions to greater than or equal to and it worked!! Thanks for all your help!!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (6,442)