surveyjs / survey-creator

Scalable open-source survey software to generate dynamic JSON-driven forms within your JavaScript application. The form builder features a drag-and-drop UI, CSS Theme Editor, and GUI for conditional logic and form branching.
https://surveyjs.io/open-source
Other
891 stars 368 forks source link

feature request: Option to display choice label instead of value in logic tab #5557

Open mgoetz-nerdery opened 2 months ago

mgoetz-nerdery commented 2 months ago

Are you requesting a feature, reporting a bug or ask a question?

Requesting a feature

What is the current behavior?

In the logic tab, expressions that reference dropdown choices show the "value" field of the selected choice. This poses a problem for my implementation, as I have a custom question type that dynamically populates a dropdown based on values I retrieve from a backend. The "value" field of the choices in this dropdown represents a UUID, which is not meaningful to end-users.

See attached screenshot: Screenshot 2024-06-04 at 2 27 18 PM

What is the expected behavior?

There could be a flag on CreatorOptions similar to showTitlesInExpressions that would control whether values or labels are displayed in expressions. When this flag is set to true, choices are rendered as labels instead of values.

Specify your

mgoetz-nerdery commented 2 months ago

cc @sandyfou

andrewtelnov commented 2 months ago

UPDATED @mgoetz-nerdery @sandyFour Interesting, we have implemented it already and I have forgot about it. It works out of the box. Here is the example. Please make sure you are using a fresh version. We release new version every week.

Thank you, Andrew