Save Partial Responses in a Single-Page Survey without clicking next button | XM Community
Skip to main content

We are working on a survey with multiple questions shown on a single page (e.g., 3-5 questions, no page breaks). Users may answer one or more questions and then close the survey without clicking the "Next" or "Submit Feedback" button.

Issue: Currently, if a user interacts with just one question and closes the survey (e.g., without submitting or navigating), their responses are not saved. This results in losing valuable user data, even though they engaged with the survey.

Requirement: I need a way to auto-save responses as soon as users interact with any question, ensuring partial responses are captured even if the user does not click "Submit" or navigate to next page.

Is there a JavaScript-based solution that saves responses on user interaction (e.g., when change or input events are triggered)? 

 

Thank you in advance for your help!

@Dhananjayan Palaniswamy,

Response data can only be saved when the Next button is clicked because that’s when the browser sends data to the Qualtrics server.

You could use a JS ajax call to save interim data to a server using an event handler, but it would have to be to somewhere other than the Qualtrics response data.


@TomG  Thank you for the response. I want the response to be saved in the survey Qualtrics data and not an external server. Is there anyway by which interim responses could be saved on Qualtrics server using a JavaScript-based AJAX call?

If that is entirely not possible, is there a way to trigger an auto-save or simulate the "Next" button functionality without forcing navigation to a new page?


Is there anyway by which interim responses could be saved on Qualtrics server using a JavaScript-based AJAX call?

 No, Qualtrics doesn’t provide an API to modify an in-progress response

If that is entirely not possible, is there a way to trigger an auto-save or simulate the "Next" button functionality without forcing navigation to a new page?

No.  What you could do is repeat the block in the survey flow as many times as you want to save interim responses, then use an event handler to click the next button each time. The same page will display with the previous answers.


@TomG  Thank you, I think this could work.

After duplicating the blocks,

  1. I need to use JS in a way that when the 1st drop list question is answered, the JS clicks next button and shows the block the second time with first question answer filled in
  2. Now the JS should force the response for 2nd question if the first question has a response
  3. JS to click next this time in the 2nd block when both 1st & 2nd question has an answer
  4. Repeat the same for third question
     

Would this work?

 

 


Adding to that, the survey should end if the user clicks “Submit feedback”, but not during the repeated survey block process with click next using JS.


First, by ‘duplicating the blocks’, I hope you really mean adding the same block to the survey flow multiple times.

  1. You can click the Next button by adding event handlers to the questions
  2. You can use custom validation with OR conditions to require or not require a response to a question based on the previous question
  3. You can JS to hide the Submit (aka Next) button until the required questions are answered. I’m not sure why you have two buttons and what the difference is …. seems confusing.

Yes, I mean adding the same block to the survey flow 3 times.

I am still stuck at step 1: Click Next button by adding event handlers to the question.

Qualtrics.SurveyEngine.addOnload(function() {
var qobj = this;
var nextButton = document.getElementById("NextButton");
jQuery('#'+this.questionId + ' select').on("change", function () {
if(jQuery(this).val()) {
//jQuery('#submitButton').click()
//jQuery('#submitButton').trigger('click')
jQuery('#NextButton').trigger('click')
//nextButton.click();
}
});
});

I tried different variations, but the script is throwing errors

 


Part of your problem is looking before it is present. I would do it like this:

Qualtrics.SurveyEngine.addOnload(function() {
var qobj = this;
jQuery('#'+this.questionId + ' select').on("change", function () {
if(this.value!=="" && this.selectedOptions[0].text!="") qobj.clickNextButton();
});
});

 


Leave a Reply