cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos

Choice Input for Components

Can we allow setting a choice option for input into a component. At the moment i can let my users add text, numbers, dates, pick colours etc. But i want to let them pass through a pre determined value which i can then use to impact the component. 

Status: New
Comments
Level 8

Can you elaborate in more detail what you want to do, and what you can't get working?

My understanding of your idea is that you want to use OptionSetsValues (from the new CDS features), e.g. for a PullDown or ComboBox inside your component.

In my case, I have already created a component which is basically just a custom-tailored ComboBox.
For this component, I just use two Input-Table-Properties "Items": 

["1","2","3","4"]

and "DefaultSelectedItems":

[""]

and one Output-Table-Property, "SelectedItems":

[""]

I can pass these directly to a ComboBox, or seed those from the ComboBox or use them otherwise.
image.pngimage.pngimage.pngimage.png
What this yields is kind of a polymorphic component that needs Value-Tables (i.e. Table({Value: bla})), but works and reacts (with some delays, or sometimes clicks necessary to update) properly to the Value property changing types , e.g.:

[1,2,3]
["1"]
Choices('Leads'.statuscode)
Table({Value: Align.Center})


You can also use Table as a workaround for passing in/out any single value by using something like

[myValue]
[First(LastN(Options, 3)).Value]
First(component.SelectedItems).Value