To deal with this problem, you can try this way:
- In survey options → Choose “Response” tab → Record incomplete survey response

- You should config embedded data at the top of survey flow
- Then use Survey Logic to Set Embedded Data (For example: If Q1 = Satisfied → Set OSAT = 4)
You can try this instead of using custom Javascript code
Thank you for the reply. We have the responses set up to record as you have shown above and I have it configured that way with the OSAT before the questions. However, where do you set up the “Survey Logic to Set Embedded Data”? Perhaps a screen shot would help.
As an additional Embedded Data block in the survey flow? Because the issue we are running into is that once they click out of the survey without finishing the first block/page and never return, the rest of the survey flow is not running.
In the survey itself? if so, how is that set up?
I’m struggling with a similar issue - I need to record the recoded value of the first question, but the user does not always go past the first question. I’ve set the first question to “auto advance” hoping that would allow me to use the OnUnload javascript, but that doesn’t seem to be working. (Perhaps the Unload and PageSubmit refer to the end of the BLOCK, not the change of page the user sees?)
I’ve also tried adding the javascript to the following question, but despite the auto-advance, abandoned surveys indicate the second question wasn’t shown to the viewer (not sure how they’re managing to close the survey so quickly!)
The only way we have found to do it successfully is by programming the links inside of the invitation to each selection and append ‘&OSAT=1’
For example:

This took us forever to figure out. But we are not using it now. Make sure you have OSAT as an embedded data item in your survey flow to get it to work.
Unfortunately, the survey I need it for isn’t sent via invitation, but is found on our website. I’ll keep looking/experimenting!
It can be done as follows:
- Set OSAT as an embedded data field in the survey flow before the question block (with no value assigned)
- Update the OSAT embedded data field in an addOnPageSubmit function attached the question
- Optionally, if you don’t have AutoAdvance turned on, you can have JS click the next button when an answer is selected on the question.
It can be done as follows:
- Set OSAT as an embedded data field in the survey flow before the question block (with no value assigned)
- Update the OSAT embedded data field in an addOnPageSubmit function attached the question
- Optionally, if you don’t have AutoAdvance turned on, you can have JS click the next button when an answer is selected on the question.
Thank you, Tom - this is how I have it set up, and it works most of the time, but not always. Usually the surveys where the second question is not displayed to the user don’t record the embedded field, but sometimes it does. Qualtrics gremlins hard at work.
I tried moving away from auto-advance to having the JS click the next button, but I wasn’t doing that right, and it would “click” before a selection was made.
Tom,
This is the code as I have it currently, where the value is sometimes captured and sometimes not.
Alternately, on a second similar project, this version has been more consistent, but still not 100%
