How to hide a question and preselect answer choice for it | Experience Community
Skip to main content
Solved

How to hide a question and preselect answer choice for it

  • May 12, 2026
  • 5 replies
  • 40 views

Forum|alt.badge.img+1

Hi,
I have 2 questions in the survey: one about birth year and the other about age group.
I want the age group category question to be pre-populated based on the birth year.
The age group choices are Boomer, Gen X, Millennials, and Gen Z. I do not want respondents to see the age group question, so I want to hide it.
But in the data, I need the answer values based on the birth year selected from the previous question.
Can we do it without using JavaScript? If not, help me with a JS code.

Best answer by Prasad Bane

You can do this without JS- 

Create normal open ended question for birth year. Then put the page break.

After that select a timer question and toggle Auto Advance switch. Keep Auto-advance after (seconds) as 0.01.

Then without page break create Age group question, make it multi choice and add your options. Then put necessary display logic on the option level. For example...Boomer will be displayed if respondent has enter the year greater than or equal to 1946 and less than equal to 1964. Then select default choices option for this question in left side pane. Attached Screen shots for clear reference.

 

5 replies

Forum|alt.badge.img+1
  • Level 2 ●●
  • Answer
  • May 12, 2026

You can do this without JS- 

Create normal open ended question for birth year. Then put the page break.

After that select a timer question and toggle Auto Advance switch. Keep Auto-advance after (seconds) as 0.01.

Then without page break create Age group question, make it multi choice and add your options. Then put necessary display logic on the option level. For example...Boomer will be displayed if respondent has enter the year greater than or equal to 1946 and less than equal to 1964. Then select default choices option for this question in left side pane. Attached Screen shots for clear reference.

 


Forum|alt.badge.img+1

Hi ​@Prasad Bane
Thank you so much for this solution. It works. But I have the same case for a few other questions, where asking for an answer in the open text is not possible.
For example, for income ranges, I have a single-select question only (cannot create an open text field for this), and I need a similar solution that captures ranges into Low, Medium, and High categories.
We can do this with the same logic you provided when the number of choices is less, but I would like to apply this to a question like birth year or similar, where the textual question response is not possible

Appreciate the help.


vgayraud
QPN Level 7 ●●●●●●●
Forum|alt.badge.img+64
  • QPN Level 7 ●●●●●●●
  • May 13, 2026

Do you need them to be actual questions?

I would either just add logic in the survey flow to fill embedded data fields with the categories or create custom bucketing fields in data & analysis. 


Forum|alt.badge.img+1

@vgayraud 
Adding them to the questions is an easy fix, I thought, instead of adding Custom buckets in data & analysis.
Interested in knowing how this can be done in the survey flow to fill embedded data fields?

Appreciate the help.


vgayraud
QPN Level 7 ●●●●●●●
Forum|alt.badge.img+64
  • QPN Level 7 ●●●●●●●
  • May 13, 2026

I don’t know, depending on the questions' position, the auto-advance solution might behave weirdly with a back button. Placing them all at the end could probably do the trick but chaining multiple auto-advance questions might also look weird for the user.

If it fits your use case and is simpler for you, all good tho.

D&A buckets have the advantage of applying to your already collected data and can be defined or redefined at any point.

I’d say survey flow logic + ED fields is in between. It would look like this: