Add exit survey option throughout and have conditional flow logic to exit message | XM Community
Skip to main content

Hi, I can't figure out how to add an exit/leave survey button that shows on every page after the third question.
I also need to add flow logic so that when clicked it takes them to the right debrief message (based on condition assigned to in question 3)
Any help would be greatly appreciated

There is no option to add an exit button. What you'll need to do is to create an  HTML button on every page. For which you can use a descriptive text question, with nothing but the button in it. You can then use a branch logic after every question/page to create a customized end of survey message. 
A simple exit button would look something like this. On clicking it, the embedded variable 

exit_survey 
is set to true and the survey goes to the next page.
onclick
="{Qualtrics.SurveyEngine.setEmbeddedData('exit_survey',true);Qualtrics.SurveyEngine.Page.next();}">Exit Survey


A more complex button that asks for a confirmation also, is something like this:
id
="exit_survey" 
style
="background-color:red;color:white;text-align:center;" 
onclick
="{exit_test = confirm('Do you want to exit the survey?');if(exit_test){Qualtrics.SurveyEngine.setEmbeddedData('exit_survey',true);Qualtrics.SurveyEngine.Page.next();document.getElementById('exit_survey').innerText = 'The Survey will now Exit';}}">Exit Survey


However, to get the desired results, one needs to ensure that there is either only one page per block or that the other pages do not display by using display logic for question on those other pages in the block.


There is no option to add an exit button. What you'll need to do is to create an  HTML button on every page. For which you can use a descriptive text question, with nothing but the button in it. You can then use a branch logic after every question/page to create a customized end of survey message. 
A simple exit button would look something like this. On clicking it, the embedded variable 

exit_survey 

is set to true and the survey goes to the next page.

onclick
="{Qualtrics.SurveyEngine.setEmbeddedData('exit_survey',true);Qualtrics.SurveyEngine.Page.next();}">Exit Survey

 


A more complex button that asks for a confirmation also, is something like this:

 

id
="exit_survey" 

style

="background-color:red;color:white;text-align:center;" 

onclick

="{exit_test = confirm('Do you want to exit the survey?');if(exit_test){Qualtrics.SurveyEngine.setEmbeddedData('exit_survey',true);Qualtrics.SurveyEngine.Page.next();document.getElementById('exit_survey').innerText = 'The Survey will now Exit';}}">Exit Survey

 


However, to get the desired results, one needs to ensure that there is either only one page per block or that the other pages do not display by using display logic for question on those other pages in the block.

 

 

Hi, 

Please can you explain where you would write this code ? Is it in the Survey flow? If yes, where do you go next?

 

Thank you


Leave a Reply