Difficulty level: Difficult
What does the functionality do?
Suppose you want to set up a maximum number of 50 participants for a survey. Once 50 participants have completed the survey, all subsequent participants will receive a thank you message upon activating the survey link. They will then NOT be able to participate to the survey anymore.
Use case and how to set it up?
Prior to the survey containing the questions and associated answers, you need to include the following question types in the survey: a Value assignment & a URL forwarding element.
The following data should be recorded at the value assignment:
- A variable name (e.g. Counter) with the value Integer number as data type.
- The function for calculating the number of interviews that meet the defined condition. It is about the function: countInterviews(survey.State==’Completed’). This function is used to count the number of completed interviews and record it in the Counter variable.
The following data must be set up at the URL forwarding element:
- The status that will be assigned to the interview (survey), once a participant exceeds the specified limit, e.g. 50 completed surveys, when activating the survey link. The status must be set to Screenout.
- The Forward to end page option.
- The text a participant will see when he/she can no longer participate to the survey because the specified maximum number of participants has been exceeded. For example, “Thank you for your willingness to participate. Unfortunately, you cannot participate in this survey because the maximum number of participants has been reached”. After this, you can optionally include the counter value in the text. Using the placeholder – here: {{custom.Counter}} – a participant will see the specified maximum number of completed surveys at the indicated position in the text.
- The Add filter button allows you to activate a window where the following data can be defined:
- Show this element
- if – Custom variable – Counter (name of the variable) – >= (greater than or equal to) – 50 (the maximum number of completed surveys)
In order to record the filter, you must click the green Save changes button. After you have published the survey, the corresponding survey can be filled out by the maximum number of participants you have specified.