Skip to main content

Notifications

Community site session details

Community site session details

Session Id : /EZtRxap6+Pl2qY6QghP8F
Power Automate - Building Flows
Answered

MS Forms automatic deletion of responses

Like (0) ShareShare
ReportReport
Posted on 23 Oct 2024 07:00:05 by 4
Hi Forum,
 
I have a Forms survey that we use weekly for collecting data of how many employees are going to be eating inhouse the next week, so that out kitchen can make the correct portions.
This is a weekly thing, so i want to automate that the Forms data is being deleted at the end of the week, so people can click and paste a response again (i have currently set the survey to be answered once only)
 
Is this possible? I dont see that Forms itself supports this, so im thinking it can be solved with a power automate flow of some sort.
  • Verified answer
    Expiscornovus Profile Picture
    31,701 Most Valuable Professional on 29 Oct 2024 at 09:16:37
    MS Forms automatic deletion of responses
    Make sure you replace the <tenant>, <userid> and <formid> by guid values. Also remove the '<' and '>' characters as well.
     
    So, the format of the link should look like the below example (I used some random ids).
    https://forms.office.com/formapi/api/5a5206d8-7b04-4c43-befb-aa25379245b1/users/fe8b03e6-e7dd-4749-b7cb-2715a18736e8/forms('HSEvendXekKorjpArMPzywSAKiQEb4BLkzEWYcY_6jRUQUpSVFJOVktEUE9RSTdaNVVJUjdPMDlTTy4u')/responses
     
    In my example I used a environment variable/parameter the tenant id, a dynamic content field from the Get My Profile (v2) for the user id and string variable called Form Id (Initialize variable action) for the form id.
     
    The tenant id can be retrieved via this website or in Entra Id for example:
     
    The form id can be found in the address bar when editing the form. The user id (if you created the form) can be retrieved via the get my profile (v2) action.
  • ML-23100640-0 Profile Picture
    4 on 29 Oct 2024 at 07:33:30
    MS Forms automatic deletion of responses
     
    I have tried to follow your steps but i reach an issue with the FormID part for some reason.
    I have setup the "initialize variable" to use "string" and then paste the FormID in.
     
    When i run the flow it keeps giving me the following error: Action 'Invoke_an_HTTP_request' failed: Invalid form id. Inner Message: Invalid form id
    (For security reasons, i have not posted the form id that is linked to the document)
     
     
    Can you see what im doing wrong?

  • Suggested answer
    Expiscornovus Profile Picture
    31,701 Most Valuable Professional on 23 Oct 2024 at 10:41:51
    MS Forms automatic deletion of responses
    Yes, this would be possible. You can use the Forms API for this.

    Below is an example for a personal form (which you created yourself).
     
    Use an Invoke an HTTP request (preauthorized action). Make sure you use the below for the connection settings
     
     
    2. In the action use the DELETE method and the below URI format
     
    https://forms.office.com/formapi/api/<tenantid>/users/<userid>/forms('<formid>')/responses
     
  • Meekou Profile Picture
    189 Super User 2025 Season 1 on 23 Oct 2024 at 07:59:33
    MS Forms automatic deletion of responses
    For your requirement, it is impossible, you could not operate Forms from power automate like delete response or create new forms.
     
    For a workaround, you could try below:
    • Add new filed like target week to indicate which week want to eat in the Form
    • Try When a new response is submitted Power Automate Trigger to save the User response to Excel file
    • Count the user numbers in Excel
    Regards,
    Meekou

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

#1
stampcoin Profile Picture

stampcoin 125

#2
David_MA Profile Picture

David_MA 118 Super User 2025 Season 1

#3
Michael E. Gernaey Profile Picture

Michael E. Gernaey 110 Super User 2025 Season 1

Overall leaderboard
Loading started