Microsoft Forms is great for many use cases. However, with some use cases you may not want the whole organization to have access to this form.
In short, we want to setup a way to allow certain users to fill out a MS form.
How can we achieve this?
My Flow below will show how to take a list from SharePoint that has users emails, to only allow them to process the Form.
** Note – You do not have to use SharePoint, you can use any means necessary. **
First you will need to have a Microsoft Form created – Any MS Form will work
Next, we setup our List of ‘Authenticated’ Emails. Again in this demo I am using SharePoint
I created a simple SharePoint List with a single text field to store email addresses
In the Flow, we create as normal with a Microsoft Form Trigger and action to get the Details
Trigger – When a new response is submitted
Action – Get response details
Next add a Variable, we make the Type an Array
Under the Variable, add Get items action, and choose our Authenticated users list that we created above
Next, add an Apply to each loop. Select the value from the Get items action.
Inside the loop, add a Append to array variable, select the variable that we initialized above. Value = the column name that stores the email Address in our SharePoint List
** Note – Make sure the Initialize variable is type Array **
Outside the loop – Add a Condition
Select the Array on the left side – Contains – Responder on the right
— We use Contains to check if the User filling out the form is in this Array of emails —
If the user who is filling out the form does not belong to the ‘Authenticated’ list, we Send an Email letting the user know they are unauthorized to fill out this form.
Under the Send an email action, add a Terminate action with Status of Success, this is to ensure the flow stops running, while not throwing an unwanted Failed run
Here is what a User will see when they do not have access
I am sure there are a million ways to add your own intuitive Authentication methods.
I hope my method helps or inspires someone else!
Thanks for reading