cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Marty_Dub
Helper II
Helper II

Building a flow for SharePoint List Management

Hi team,

 

PowerAutomate beginner here. I am wanting to design a solution to assist with the management of SharePoint lists.

 

My list contains a column "Completed Date", and I am wanting to have the flow filter by this column for any rows with a Completed Date older than 6 months, then append that data over to another list (for archiving), and then finally remove the rows from the original list.

 

Any suggestions on how to best approach this? (or is this even possible)

 

Thank you in advance 😃

1 ACCEPTED SOLUTION

Accepted Solutions
edgonzales
Super User
Super User

@Marty_Dub 

Hey there.  Totally Possible.

 

You have loads of options on how to approach this, but probably the 'easiest' way is something like this:

 

  • Recurrence or Manual trigger (depending on how often you want this thing to run....if it's a one-time deal, then manual...otherwise a recurrence with whatever cadence you'd like.
  • Get Past Time - Set the interval to 6 Months. This step just gives us a date from 6 months ago.  You can replace it with an expression later when you're more comfortable with that.
  • SharePoint list items (If you're comfortable with OData filters or XML, you can add the filter to this step and skip the next one.
  • Filter Array where "Completed Date" is less than the output from the "Get Past 2Time" output.
  • Next, use a "Add item to SP list" and drop in the fields from your filter array or list rows (if you didn't use the filter).
  • Don't freak out.  It's going to trigger an Apply to Each loop.  Power Automate does this whenever you give it a list of things to work through.  So, it's going to work through each item on that list...which is good.
  • Inside the Apply to Each loop, add another step to "Delete Item" and make sure you point it to your original list (the List Rows one), and use the id from the current item.  This will delete the item, one at a time, after it has been created in your other (archive) list.

Hopefully that's enough to get you going.  Good luck, and keep us posted.

-Ed

 

If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

View solution in original post

2 REPLIES 2
edgonzales
Super User
Super User

@Marty_Dub 

Hey there.  Totally Possible.

 

You have loads of options on how to approach this, but probably the 'easiest' way is something like this:

 

  • Recurrence or Manual trigger (depending on how often you want this thing to run....if it's a one-time deal, then manual...otherwise a recurrence with whatever cadence you'd like.
  • Get Past Time - Set the interval to 6 Months. This step just gives us a date from 6 months ago.  You can replace it with an expression later when you're more comfortable with that.
  • SharePoint list items (If you're comfortable with OData filters or XML, you can add the filter to this step and skip the next one.
  • Filter Array where "Completed Date" is less than the output from the "Get Past 2Time" output.
  • Next, use a "Add item to SP list" and drop in the fields from your filter array or list rows (if you didn't use the filter).
  • Don't freak out.  It's going to trigger an Apply to Each loop.  Power Automate does this whenever you give it a list of things to work through.  So, it's going to work through each item on that list...which is good.
  • Inside the Apply to Each loop, add another step to "Delete Item" and make sure you point it to your original list (the List Rows one), and use the id from the current item.  This will delete the item, one at a time, after it has been created in your other (archive) list.

Hopefully that's enough to get you going.  Good luck, and keep us posted.

-Ed

 

If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

Marty_Dub
Helper II
Helper II

Thanks @edgonzales!  That approach seems to be working pretty seemlessly with moving the rows between lists.

 

Just an FYI for anyone else playing at home - SharePoint Get Items defaults to a 100 item limit. Go into the settings of the Get Items step, enable pagination and bump the threshold up to enable it to capture more items each run.  

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (1,283)