cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
aadilganie
Advocate IV
Advocate IV

Delete Items From SharePoint List Using Date From Excel File

Hi Everyone,

I have an excel file that has been exported from SharePoint. After a cleanup some of the items in the excel file have been marked for deletion in SharePoint.

 

I have managed to to start a flow and retrieve all the values that need to be deleted from the excel file. How do I go about deleting items from SharePoint matching those from the excel file?

5 REPLIES 5
ScottShearer
Super User
Super User

What you'll need to do is use an Apply to Each loop to loop through all of the items that you want to delete.  In the loop use a SharePoint Delete Item action.  The Delete Item action will need to use the ID of the SharePoint item that you want to delete.

 

If you need additional help, please post a screen shot of your Flow.

 

Scott

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

Scott
v-yuazh-msft
Community Support
Community Support

Hi @ aadilganie,

 

Could you please share a screenshot of the configuration of your flow?

Have you managed to retrieve all the values that need to be deleted from the excel file?

 

You could refer to steps below:

1.Add an "apply to each" to get each need to be deleted row in the excel file.

2.Add a "Get items" inside the "apply to each" to get all items in the list.

3.Add an "apply to each 2" under the "Get items" to get each item in the list.

4.Add an Condition inside the "apply to each 2" to check if the item's "Title" column is equal to the excel row's "Title" column.You could all check any other column.

5.Add a "delete item" action to delete the item which's "Title" column is equal to the excel row's "Title" column.

 

The screenshot of the flow as below:

Capture.PNG

 

The flow would run successfully to delete the items which's "Title" column is equal to the excel row's "Title" column as below:

Capture.PNG

 

 

 

Regards,
Alice Zhang

Hi Alice,

Thanks for your reply. I am going to try the way you've outlined below and will reply back soon. I have done something similar but did not put the apply to each within the other, so this might work..

 

Thanks!

Hi @v-yuazh-msft

I have tried your method, it seems like the right way but its seems to be taking very long, i let it run for 6 hours and it didnt stop. I have 992 to delete of a total of 1013 items that are in the list, may be theres too many items?

This is a screenshot of my workflow currently:

Screen Shot 2018-04-20 at 17.27.17.png

Hi Alice

I try to build this, but in "Apply to each 2" I can't do a condition with the "Title" from Excel. Why would this not be available?

 

And if I understand correctly, the this step would be executed for Each "Apply to each", meaning the "Get items" from shrarpoint would be done for each line in Excel? If yes, is there a better way, to load Sharepoint only once?

 

aso to mention your post is about 3.5 years old. so I have some different choices. e.g. instead of "Get row" I used "List rows present in a table" but I guess, this is doing the same thing.

 

Thank you for any hints...

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Users online (3,919)