Identification code on a longitudinal study

iamoiamo Lisbon, PortugalCommunity Member Qubie ✭

Identification code on a longitudinal study


I will start a longitudinal study with 3 time points. We have planned to generate an individual code that will allow us to identify each participant at T1, T2 and T3, ensuring his anonymity. This code consists on 4 elements that comes from 4 questions (e.g.: first letter of first mother's name, birthday day, ...). Considering our target population, it is easier to ask the 4 questions individually, rather than asking to the participant to write the final code based on those informations.

Is there any way of Qualtrics automatically generate this code from the participant's answers? And to consider it as an ID?

Thank you very much!



Best Answer


  • ahmedAahmedA IndiaCommunity Member Superuser ✭✭✭✭

    String manipulations are not possible in Qualtrics, you'll need to use JS. The following code will work for you if you only ask those specific question and in the correct order. It will create an embedded variable called code which you can use in the survey.

    Qualtrics.SurveyEngine.addOnReady(function () {
    	that = this;
    	document.querySelector("#NextButton").onclick = function (){
    		person_code = [];
    		entries = that.getChoiceContainer().querySelectorAll("input");
    		entries.forEach(item => person_code.push(item.value.charAt(0)));
    		Qualtrics.SurveyEngine.setEmbeddedData("code", person_code.join(""));
  • iamoiamo Lisbon, PortugalCommunity Member Qubie ✭

    Dear ahmedA,

    Thank you so much! It is that the case, always the same questions and the same order. But I need to back to basis, I'm a new qualtrics user... Where should I put the code that you have mentioned?

    Thank you very much for your help!

  • iamoiamo Lisbon, PortugalCommunity Member Qubie ✭

    Thank you very much!!

Sign In to Comment