Record Last Question when partially completed responses are set to complete. | XM Community
Skip to main content
Hi All,



in the In progress part of the survey data and anlysis, there is a field called 'Last Question'. For surveys that remain partially completed and then after a week are converted to completed, it would be great to record the question they reached. This field doesn't seem to be available outside the in progress part and so I probably need to find a work around. Any bright ideas (the simple the better) would be greatfull. We have over 100 questions in the survey by the way and so I would rather not be setting up a field and adding an embedded field below each question (perhaps by block would be doaable) but please let me know all your ideas first so that I can figure out what might work.



!





Thanks



Rod
Hello @Rod_Pestell ,



You can add a header script as - on submit capture the QID in an embedded data.
Hi Shashi,



That sounds like that will work for future response - thanks. Please could you help advise on the script? I assume when you say header you, mean I add a script to the header part of the theme window? Do you have to publish the survey to make this active?



I had a quick look and am thinking the script will involve the method setembeddeddata (https://s.qualtrics.com/WRAPI/QuestionAPI/classes/Qualtrics%20JavaScript%20Question%20API.html#method_setEmbeddedData)?



Also, is there any way to do this for past responses?



Thanks.



Rod
Hi @Shashi,



Any chance you could advise on the script to use in the header. I'm a VBA programmer but not java so would be grateful for some initial help.



Thanks



Rod
@Rod_Pestell Just wanted to hop in here and suggest you contact support to file a Feature Request. I just did too because the data exists and I want it!

Hi ​@JenCX Well I’m circling around this again and found two ideas.  Would be nice if Qualtrics could explain why they haven’t progressed the ideas.  Is one (or two) of them yours?

 

@SaShi Just wondering if you could share your solution in the meantime?

 

 

Thanks

 

Rod Pestell


​Hi @AlonsoC, just looping you in as perhaps you can find out a little more about the reason why these ideas were not progressed or you can enquire with the engineering team if there is in fact a system field that we can use already (but not in the formal list of system variables).

 

Thanks

 

Rod Pestell 


​Hi @AlonsoC, just looping you in as perhaps you can find out a little more about the reason why these ideas were not progressed or you can enquire with the engineering team if there is in fact a system field that we can use already (but not in the formal list of system variables).

 

Thanks

 

Rod Pestell 

Hi ​@Rod_Pestell!

Thank you for your patience! I've passed your question to the Evolve team, but please note that their response may be delayed due to the Thanksgiving holiday in the US. In the meantime, our support site is fully updated with the latest Qualtrics functionality. I understand it can be overwhelming to navigate, so I recommend utilizing the chatbot for quick answers and relevant links. 


Hi ​@Rod_Pestell, the below is working on my end to save the last questionid on a page to an Embedded Data field once the page is advanced. Might work in the meantime until hopefully the feature becomes available in platform. First, create an Embedded Data field called "LastQuestionID" and put it at the top of the Survey Flow. Then, in the General section of the Look & Feel, use source mode "<>" to add the below to the survey's Header:

<script>

Qualtrics.SurveyEngine.addOnPageSubmit(function(type)
{

const questionsContainer = document.querySelector("#Questions");
const questionDivs = questionsContainer.querySelectorAll(".QuestionOutertquestionid]");
const lastQuestion = questionDivsiquestionDivs.length - 1];
const lastQuestionId = lastQuestion.getAttribute("questionid");
Qualtrics.SurveyEngine.setEmbeddedData("LastQuestionID", lastQuestionId);

});

</script>

 


Thanks ​@Tom_1842 ,

 

That will be great start.  Thanks very much

 

Rod Pestell

 


Leave a Reply