Official Site
Microsoft Most Valuable Professional M365 Apps & Services
Microsoft Most Valuable Professional Business Applications
Consultant & Sr Cloud Solution Architect Modern Wokrplace
Find hereMore than 150 Articles about Microsoft Technologies on Modern Workplace
18 April 2024
In today's article, we will see how to delete all items in list on SharePoint using HTTP POST and Power Automate.
First, you need to have an active M365 subscription and navigate to the Power Automate homepage. Then, select "Create" from the left menu and choose "Instant cloud flow."
Select the first action "Manually trigger a flow" and give your flow a name.
In the initial trigger action, we need to set the condition to activate the automate.
In the next step, we need to create a new action of type "get items" to retrieve all the items from the list. We specify the site hosting the list in the Site Address and then the list in the List Name.
The next action is of type "send HTTP request to SharePoint" where we first need to specify the site hosting the list in the site address. Then, for the method, we select DELETE and in the Uri we set _api/web/lists/GetByTitle('Bank Employee Onboarding')/items(ItemID) where if we set the ItemID property from the get items, it creates a foreach to cover all the items. Note that we also need to add IF-MATCH = * in the request headers.
We save the automate and get a warning for the get items combined with large datasets and performance, but we continue anyway.
We manually execute the test flow.
We allow all necessary connections.
And select run flow.
The flow runs.
And as you can see, it has completed successfully.
And indeed, it has gone to the list and deleted all the entries.
Visit Archives below to find more articles about Microsoft technologies on Modern Workplace