In the previous post, we’ve covered the .NET application that connects to Confirmit APIs and closes a project.
Let’s see now what we need to do in order to actually call it from a Confirmit survey.
Since the topic is close a project when the quota is reached, we’ll first need a condition node, with a quota check qf(‘quota1’)
In the “then” branch, you continue to use your own scripts, set the respondent status SetStatus(‘quotafull’) and everything else you may have, but not do the redirect yet (if you’re using one)
Add an info question type with the following content. You can use the instruction area as well.
As you can see the only parameter we send is the project ID.
There could be more to add, like showing a div with a message “Please wait!” or an ajax loading gif etc
For a better understanding on how everything works, as soon as the quota is reached, the first respondent who gets in the condition qf(‘quota1’), true now, will trigger the call to the .NET app that closes the study.
After this, it doesn’t mater how many respondents are currently on the link, no one else will made it to the end (of survey). If clicking on the “next” button, the system will answer with the standard message, “Sorry, but this survey has been closed.”
Check an older post, and find out how can you customize it for this particular study (you can also have a redirect right from the theme)