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?
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.
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:
The flow would run successfully to delete the items which's "Title" column is equal to the excel row's "Title" column as below:
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..
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:
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...
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
At the monthly call, connect with other leaders and find out how community makes your experience even better.
If you are a small business ISV/Reseller, share your thoughts with our research team.