cancel
Showing results for 
Search instead for 
Did you mean: 

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
SaWu
Impactful Individual

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
PowerunAppy
Advocate IV

I would like to see something that would be somewhat compatible with a Choice field in SharePoint - but which doesn't have to be linked to SharePoint in any way.

I would suggest that there be a basic choice table format like this:-
[ {Id: n, Value: "First"}, {Id: n+1, Value: "Second"}, {Id: n+2, Value: "Third"} ]

 

The choice field would prompt for a table like object such as that above, and a Default Selected Items property which would be either empty or set (most usually to a single-record table of the format above).