Scenario: SharePoint Administrators would love to delete User alerts subscribed to a list/library in one go. But unfortunately there is no way in User Interface that is allowed, you have to do it one by one for every user which is not efficient and very time consuming.
In my Previous blog "Get list of Users Subscribed to OOB Alerts", you can get all Alerts which is also not possible via User Interface.
In this blog I will show how to Delete Alerts for a specific List and the task can be achieved in few seconds.
Below is how the Overall uncollapsed version of the Flow looks like. I will break it up further.
1. First we need to connect to the site. so HTTP REST API call to get the Alerts .
Compose data operation "Access Token' enter ' "@outputs('HTTP').body.access_token" ' (with double quotes which is in Bold
Compose data operation "Compose" enter ' "@outputs('HTTP_2').body.d.results" ' (with double quotes which is in Bold
4. Next we are checking for a specific List from which we want to delete all the OOB Alerts. Add a Condition where 'Output of ListTitle' is equal to the List.
5. Last step of Alert deletion. If condition is met, we run another HTTP REST API method "DELETE". The syntax for delete is " /_api/web/alerts/deletealert('Alert ID') " . So we need to replace the 'Alert ID' with the output of the compose action where Alert ID of the current item is stored. ( Pls. Note: REST API Method call will be "DELETE" )
On a Successful Deletion once the Condition of List Title is met, HTTP Call for Delete Method will look like below.