Delete Microsoft Forms responses
Within Microsoft Forms it is possible to delete all responses of an individual form. In this article I will show you how to delete these via a Power Automate flow.
Inspiration
This question from _poweruser_:
I’m trying to create a flow that will clear Microsoft Forms responses every week (so the form can be reused as it is a weekly check-in). I have set up the flow like the below following a guide I saw on YouTube..
Power Platform Community thread: Send an HTTP request to SharePoint action DELETE Method request returning “405 Method Not Allowed”.
Invoke an HTTP request
In the past I always used the Send an HTTP request to SharePoint action and the Forms API for this. But Microsoft locked down the usage of the Send an HTTP request to SharePoint action in September 2024. Which meant you weren’t able to use that action with the Forms API anymore.
Alternatively, you can use the Invoke an HTTP request action of the HTTP with Microsoft Entra ID (preauthorized) connector. Read more about this change in the Send an HTTP request to SharePoint – Forms API – Flows Failing since 18-09-2024 Power Automate community thread.
Flow Setup
For this sample I am using Personal Microsoft Form, for a Groups Microsoft Form you would need a different URI structure.
1. Add a Recurrence action.
a. Select an Interval, in this setup 1
b. Select the Frequency, in this setup Week
c. Select On these Days, in this setup Sunday
d. Select the Hours, in this setup 20
e. Select the Minutes, in this setup 15
2. Add a Get my profile (v2) action (optional).
3. Add a Initialize variable action (optional).
a. In the Name field use FormId
b. Select the Type String
c. Add the id of your Form as the value
4. Add an Invoke an HTTP request action.
The URI uses the tenant id (which in my case is a parameter), the id of the user who created the form and the form id (which is retrieved from the Form editor in the browser).The tenant id can be found in Entra Id or via the following website, just enter your domain: https://www.whatismytenantid.com
a. Create a new connection and use https://forms.office.com in the Resource URI and Base Resource URL
b. Use the DELETE method
c. Use the URI from the code snippet below
d. Use the Headers from the code snippet below
That should be it for the setup.
Happy testing!