code a blank response to no | XM Community
Solved

code a blank response to no

  • 1 August 2023
  • 6 replies
  • 78 views

Userlevel 4
Badge +4

Hi All,

Is it possible to code a yes or no question to record a no if the respondent leaves it blank? 

It is an option question multi choice. 

icon

Best answer by TomG 1 August 2023, 22:58

View original

6 replies

Userlevel 6
Badge +23

Yes - there is a few ways to do this, depending on how you plan to use the data afterwards as well. 

I’d likely look to create a new custom field, using a formula to associate a derived variable based on a blank response for this question. Refer to Custom Field Creation (qualtrics.com). We often use this for giving variables to responses where customer was not shown the question due to not meeting the survey logic rules i.e. customer not eligible or customer did not answer. 

Userlevel 4
Badge +4

@ScottG  is it possible to use embedded data to automate it, instead of using the custom field creation?

Userlevel 6
Badge +23

@ScottG  is it possible to use embedded data to automate it, instead of using the custom field creation?

Maybe, however not sure you have a variable for blank to code in for this instance. Someone else might be able to jump in on that one.  However once we set up the custom field/derived variable this field continues to be populated for new responses, so is in a sense automated.   We use this variable in our dashboards. 

 

Userlevel 6
Badge +18

@ScottG  is it possible to use embedded data to automate it, instead of using the custom field creation?

I believe you can do so, I would go with creating an embedded variable which by default (hard coded) have the value of “No”, Ex. Q1_ED = No,

Which will ONLY be then overwritten to Q1_ED = Yes with the help of branch condition if respondent has selected “Yes”,

If respondent has left the question blank OR have answered “No”, then the hard coded value will come in to picture and punch variable as “No”

Userlevel 7
Badge +27

You could use JS to select ‘No’ if nothing is selected when Next is clicked (‘No’ is choiceid 2):

Qualtrics.SurveyEngine.addOnPageSubmit(function() {
var q = jQuery(this.questionContainer);
if(q.find("input:checked").length==0) q.find("[choiceid=2]").prop("checked",true);
});

 

Userlevel 4
Badge +4

@TomG  thank you. It tested beautifully. 

Leave a Reply