Skip to content

Using an option picker label instead of the value #10950

Answered by ConorWebb96
FlaminWrap asked this question in Help
Discussion options

You must be logged in to vote

Hey @FlaminWrap,

Currently you are only able to set the value as I'm sure you have been doing. I'd recommend creating a enhancement request if you want to expand this functionality to include the labels as well.

With there being so few labels might I suggest something like this for a potential solution?

  1. Update state on the options picker change.
2. Use the below function to output the labels.
var fields = [
  { value: "%", label: "All Areas" },
  { value: "ABC", label: "Area 1" },
  { value: "DEF", label: "Area 2" }
];
var selectedValue = $("State.output");
var matchingField = fields.find(function(field) {
  return field.value === selectedValue;
});
if (matchingField) {
  return match…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by FlaminWrap
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
picker Relating to Options and Multi-select pickers bb-bindings
2 participants