Auto-Populate Field in Drill Down Group Using JavaScript | XM Community
Skip to main content

I need help automating responses within a drill-down question in Qualtrics. Specifically, I have three groups in the drill-down question:

  1. Group 1: Income in 2023 (answer options: income ranges).
  2. Group 2: Whether income has changed in 2024 compared to 2023 (answer options: Yes/No).
  3. Group 3: Income in 2024 (answer options: income ranges).

I want to automatically populate Group 3 with the same value as Group 1 if the respondent selects "No" for Group 2. For example, in my picture, the field for 2024 will be automatically display Less than €12,189 if the answer to changes is no. This would save respondents from having to manually select the same value again in Group 3. I am completely new to JavaScript and would really appreciate your help! 

You don’t need JS for this. Since you said you have the display logic for field 2024, you use this condition to set the embedded data to store the value.

i.e - If field 2024 is displayed, set embedded data from the respective field itself.

If the field 2024 is not displayed, set value in the same embedded data from option chosen in field 2023. 

 

Make sure you use the same embedded variable in both conditions. this makes easy for reporting purposes.


@w29913,

If you’re interested, I have a JavaScript that auto completes and hides drill-downs with only one choice. Details here


@w29913,

If you’re interested, I have a JavaScript that auto completes and hides drill-downs with only one choice. Details here

This function might be more advanced than what I need, as I may not require such depth. However, may I know the fee for using it for reference? Thanks! 


Leave a Reply