Forum Discussion

ToniS290's avatar
ToniS290
Copper Contributor
May 25, 2022
Solved

Delete Survey Data after certain period

Hello,   due to GDPR I have been asked if it is possible to automatically delete data from Microsoft Forms surveys after a certain period (i.e. 180 days).  Is it bound to Retention Policies or d...
  • RobElliott's avatar
    May 25, 2022

    ToniS290 the form responses are not tied in to retention policies and, by default, a form owner needs to go into the spreadsheet behind a form and delete all responses. This is prone to people forgetting and it not getting done, opening up the company to possible consequences of GDPR breaches. But you can do this automatically with a flow in Power Automate which can run on a recurrence and regularly delete the responses from your form. This is much more robust than relying on someone to remember to do it! I learnt the method from DamoBird365 who has a great video on this at https://www.youtube.com/watch?v=eq6QRz29q9Q

     

    When you go into Power Automate copy your tenant ID from the address bar. For the trigger I've set a recurence schedule trigger to run once a week but of courase you can set it to a different schedule:

     

     

    Add a compose action, name it TenantId and paste in the tenant ID you copied earlier.

     

    Next add another compose action and paste in the user id. You get this from Delve -> Me and it's in the address bar. If it's a group form, open the group in Forms and the Group ID is in the address bar.

     

    Next, add a third compose action and paste into it the form ID.

     

    Finally, add a Send an HHTP request to SharePoint action. Set the site address to https://forms.office.com. Set the method to DELETE. In the uri field paste in 

     

    /formapi/api/Outputs of your TenantID compose/users/Outputs of your GroupID compose/forms('Outputs of your FormID compose')/responses

     

    Name your flow, save it and test. It will delete all the responses within a few seconds, then it will do so every week from then on.

     

    Rob
    Los Gallardos
    Microsoft Power Automate Community Super User

Resources