Capture data in hidden question | XM Community
Skip to main content
Solved

Capture data in hidden question

  • June 23, 2023
  • 7 replies
  • 78 views

praveengeorgeix
QPN Level 4 ●●●●
Forum|alt.badge.img+11

Hi

We have created an invite outside Qualtrics (screenshot 1). Each button is having a link to the associate button in Qualtrics NPS question.

 

screenshot 1

 

When clicking for example 8 the nps question will show up again in the qualtrics link as 8 being selected.

screenshot 2

 

 

Is there a way to hide the NPS question in survey to avoid showing up in email and survey? It should capture the data.

Display logic = false wont work

 

Could you help please.

Best answer by praveengeorgeix

Thanks guys. I got a small code which worked.

Qualtrics.SurveyEngine.addOnload(function() {

    

  /* Place your JavaScript here to run when the page loads */

    

setTimeout(function() {

jQuery("#NextButton").click();

}, 0); /*replace 0 with required milli second*/

});

7 replies

Forum|alt.badge.img+15
  • QPN Level 4 ●●●●
  • June 23, 2023

Hi @praveengeorgeix,

 

Have you tried autoforward through Qualtrics timer question or javascript at NPS question?

That should do the trick for you.

 

Thanks,

JB


praveengeorgeix
QPN Level 4 ●●●●
Forum|alt.badge.img+11
  • Author
  • QPN Level 4 ●●●●
  • June 23, 2023

I have set auto advance on question checked but it doesnt work.

Is using javascript a better option. If yes could you please help me with the code. Im not familiar with JS

 


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • June 23, 2023

Try this:

Qualtrics.SurveyEngine.addOnload(function() {
jQuery(this.questionContainer).hide();
}

Qualtrics.SurveyEngine.addOnReady(function() {
if(jQuery("#"+this.questionId+" input:checked").length>0) this.clickNextButton();
});

 


praveengeorgeix
QPN Level 4 ●●●●
Forum|alt.badge.img+11
  • Author
  • QPN Level 4 ●●●●
  • June 23, 2023

Thanks @TomG For some reason the script is not working 

. I tried the jscript for timing from a different page and its working now.

Thanks for your suggestion

 


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • June 23, 2023

Thanks @TomG For some reason the script is not working 

. I tried the jscript for timing from a different page and its working now.

Thanks for your suggestion

 

You can try delaying it:

Qualtrics.SurveyEngine.addOnReady(function() {
var qobj = this
setTimeout(function(){
if(jQuery("#"+this.questionId+" input:checked").length>0) this.clickNextButton();
},200);
});

 


Forum|alt.badge.img+15
  • QPN Level 4 ●●●●
  • June 23, 2023

I would suggest adding timer with autoadvance in 0.01 should work.

 

Havent tried it, but I think below change to Tom’s code should also work. 

 

Qualtrics.SurveyEngine.addOnReady(function() {
if(jQuery(".q-checked").length>0) this.clickNextButton();
});

Also, please check the Theme layout you are using. If you are using simple layout, many things may not work.

 

Thanks,

JB 


praveengeorgeix
QPN Level 4 ●●●●
Forum|alt.badge.img+11
  • Author
  • QPN Level 4 ●●●●
  • Answer
  • June 27, 2023

Thanks guys. I got a small code which worked.

Qualtrics.SurveyEngine.addOnload(function() {

    

  /* Place your JavaScript here to run when the page loads */

    

setTimeout(function() {

jQuery("#NextButton").click();

}, 0); /*replace 0 with required milli second*/

});