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 / Archive List Items Old...
Power Automate
Answered

Archive List Items Older than 15 days based on Created Date to Archive List

(0) ShareShare
ReportReport
Posted on by 6

Hey there Power Automate gurus. I am looking for some assistance with creating a flow. I'm somewhat new to Power Automate/Power Apps but so far I've been a quick study (thanks Google) so forgive me for possibly using incorrect terminology.

 

I'm looking for a way to automatically archive items in a SharePoint List daily. I would like to copy items older than 15 days based on the 'Created' Date to an identical 'Archive' list and delete the original items. Every solution I've found through this site and google answers always leaves out important details to get it to work (or perhaps I'm not understanding).

 

I have the following hopes for this:

  • Run Daily (Recurrence) - Figured this out
  • Copy from Sharepoint List A to Sharepoint List B - Kinda figured this out but only single items at a time that I had to select
  • Threshold is 15 days based on the Created date column - Not a clue
  • Only move Items in 'Completed' or 'Denied' status (this is a column item for a Powerapps Dropdown) - Even less of a clue
  • Delete the original item from Sharepoint List A (again, only if in Completed or Denied status) - Kinda figured this out but got an error when it was trying to delete the item

 

I've mostly figured out the Recurrence, Get-Item, Created Item, and Delete Item portion of this. It's the Thresholds I'm stuck on.

 

I appreciate any and all help you can provide! Apologies if I missed a similar question/answer but I did spend quite some time finding something that was well-written enough to apply to my scenario.


EDIT: If an Admin is able to move this to the Flow Building area that would be swell. I thought I was in that forum when I asked my question but apparently not.  

Categories:
I have the same question (0)
  • VJR Profile Picture
    7,635 on at

    --This post is now in the Building Flows section of Cloud Flows 🙂 --

  • Verified answer
    grantjenkins Profile Picture
    11,063 Moderator on at

    Hopefully this is what you're after.

     

    For this example, I'm using the following identical lists.

     

    grantjenkins_0-1672212553703.png

     

    grantjenkins_1-1672212571996.png

     

    The full flow is below. I'll go into each of the actions.

    grantjenkins_2-1672212622326.png

     

    Recurrence is set to run daily as what you already have.

    grantjenkins_3-1672212657111.png

     

    Get items returns items from Projects List using the following Filter Query. The first two are related to the current status, and the last is subtracting 15 days from the current date/time and checking to see if the items are less than that date/time. This will ensure only the items we want to archive are returned.

    (ProjectStatus eq 'Completed' or ProjectStatus eq 'Denied') and Created lt '@{addDays(utcNow(), -15)}'

    grantjenkins_4-1672212799889.png

     

    Apply to each will iterate over each of the items and create the corresponding item in Projects List Archive then delete the item from Projects List.

    grantjenkins_5-1672212901965.png

     

    Create item takes the data from Get items. Note that I also have an Approved column in my list which you can just ignore.

    grantjenkins_6-1672212953197.png

     

    Delete item then removes the item using the ID from Get items.

    grantjenkins_7-1672212994336.png

     

    The result of running the flow from this example is below:

     

    grantjenkins_8-1672213115694.png

     

    grantjenkins_9-1672213130896.png

     

    Let me know if any questions, issues, etc.


    ----------------------------------------------------------------------
    If I've answered your question, please mark the post as Solved.
    If you like my response, please consider giving it a Thumbs Up.

  • SMHHoward Profile Picture
    6 on at

    This is exactly what I was looking for, thank you!

  • jjcook Profile Picture
    30 on at

    Hi there, this is super helpful, thank you!

    However, I have come into an issue with the filter in the 'Get Item' step. This is what I have: (Status equals 'Completed') '@{addDays(utcNow(), -30)}'

    Could you help me understand how I fix this please? 

     

    Thank you!

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 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard