Forum Discussion
MS Form Limit Number of Responses
- Nov 13, 2019
Hi Corcorank, no you can't do this directly from Forms. All you can do is to use Flow to save the response to a SharePoint list. If the ID is less than or equal to 5 then send an email to accept them, if it's more than 5 send a "sorry...." email.
Rob
Los GallardosMicrosoft Flow Community Super User
huudao (and Corcorank sorry for the very long delay, I'd lost track that I hadn't posted up the steps). The way I do this is to have a separate list to hold the current number of participants for that course. So initially you would create the item in that list (there will only ever be 1 item) and set it to 0. It will increment by 1 as each user signs up.
You would hold the details of the participants in your main list:
The flow is as follows. When a new response is submitted, get the response details. Next get the row from the SharePoint Course increment list:
Next, add an apply to each and select value from the Get items in the dynamic content box). Add a Compose control (which I've named ComposeCurrentNumber) to hold the number from the NumberSignedUp column.
Next, add a Condition: if the output of the ComposeCurrentNumber is less than or equal to 9. This means that if the increment list has a NumberSignedUp value of 10 you don't want to sign up any more people.
I recommend you set the concurrency settings in the Apply to Each to On and set it to 1 so that if 2 people respond at the same time the flow will run correctly and increment number won't get out of sync:
In the green if Yes channel add a SharePoint Update item action to increment list and set the new value of the NumberSignedUp column to the following expression:
In the red If No channel, add the same Update item action to add 1 to the increment list, then send the "sorry.." email.
The last action in the green If yes channel is to send a "You are registered..." email
The email for the first 10 participants is shown below:
And the "sorry.." email is:
One of the advantages of this method is that even though it won't add anyone after the 10th person the the course, it still updates the increment list. So you now how many people wanted to attend if though only 10 could do so.
Rob
Los Gallardos
Microsoft Power Automate Community Super User