Forum Discussion
Limit number of responses on a form
It would be nice if there was a way to limit the number of times somebody can respond on a form. For example, I use it for students to sign out of the room. I would like to limit the number of times to 4 a quarter. Any suggestions??
- Alan MarshallNov 16, 2018Iron ContributorPut 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, teNov 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, 2018Iron 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, teNov 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.