Forum Discussion
Erica Schwiening
Jun 18, 2017Brass Contributor
Limit number of responses on a form
It would be really useful to be able to retrict the number of responses to a form. I use microsoft forms as an ordering device for food and need to be able to limit the number of responses (in a sim...
Alan Marshall
Nov 16, 2018Steel Contributor
Put some sort of approval or validation after the form is completed so the form is a request but the recipient has to get an approved email first. To do this, use Flow to capture when a form is completed and write the data to a SharePoint list, you would add a step to query the list to get previous bookings or request for the room or the person using the Odata filter, then just add a condition on the count of the returned items from SharePoint and send either apporved or declined email. You could also add an email to yourself when a limit for a room booking is reached so you can put an end date on the form to stop further submissions.
Sabine Rietstap, te
Nov 17, 2018Brass Contributor
Hi Alan,
It is nice to get an answer to a request I've had ever since I'm using Forms. Your solution seems okay as far as I understand your solution, I'm not that big on Flow and Sharefilelists and filters.
I do not know how to capture a Form with Flow, how to sent data from Forms to a SharePoint list, I never heard of an Odata filter so you see although I logically understand your answer (make a datalist, check it, send an email) as do I understand how my bicycles work but, sadly, that doesn't mean I kan build them.
So your answer is very much apreciated but I'm afraid it will take me the better part of a few days before I'll be near a replication of your solution. I hope I will have some days in the coming months, to try to make this work, but that will not be very likely.
Thank you very much for reacting, it was very nice thing to do.
- Alan MarshallNov 20, 2018Steel Contributor
I created this example that you can use to create the Flow.
I have a basic form with one question but can be more that runs to a particular day. Each person can only respond once (for testing I turned this off).
Create the Flow trigger by item added with actions for getting form responses, get list items, condition on item count and then either email "no space" or get user details and add to SharePoint.
If the get items, I created a Filter query: Course eq 'Forms and Flow training' this would match whatever you store in the Create item action.
The condition formula is length(body('Get_course_attendees')?['value']). To create this, select Expression from the field selector that pops up and select length. Then click on Dynamic content and pick the Value field corresponding to the name of your Get Items action.
I then check if its 1 as I only have space for 1 person on my course, you would obviously put in a higher number.
You can also use values from the form in your SharePoint filter query. filter query documentation
I exported the flow as well that is attached for you to import.
- Sabine Rietstap, teFeb 14, 2020Brass ContributorThis works, if there is just 1 choice. The problem in a school is that you have often many groups that you want your students to be able to choose from. Every educational software seems to understand this need, and still nothing form Microsoft. It has been some years since I asked for this improvemnt
- mf_javedMar 27, 2019Copper Contributor
Alan Marshall Can you please help me understand your steps when you are on Ms Flow?
- deSabineMar 05, 2019Copper Contributor
Thank you for this reaction an explanation. I’m going to try this, it looks doable :)