survey-library icon indicating copy to clipboard operation
survey-library copied to clipboard

Allow variables to have choices

Open SamMousa opened this issue 6 months ago • 1 comments

Is your feature request related to a problem? Please describe. Imagine I add a variable to a survey. The possible values for this variable are A, B, C.

survey.setVariable('Test', 'A')

In the creator I will be able to add routing based on this variable:

Image

Describe the solution you'd like It'd be great if there was some way to let the survey engine / creator know that the possible values are just A, B and C. This will allow for a way cleaner UX when setting up conditions.

Describe alternatives you've considered The only alternative I have found is to create constructs like hidden questions that are used to define a "schema" ie choices, but is are never shown to the user.

Additional context Variables are one thing where this is relevant, but calculated values suffer the same.

What we'd need in theory, not sure how to do it in practice, is something that:

  • Behaves like a single or multiple choice question when it comes to configuring choices
  • Is never shown to the user
  • Has a "realtime" value similar to calculated values.

SamMousa avatar Apr 25 '25 09:04 SamMousa