cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Skilled Sharer
Skilled Sharer

How to set the value for a PCF Optionset control inside a CanvasApp

I've implemented a PCF Control for an Optionset attribute: https://github.com/ORBISAG/ORBIS.PCF.ColorfulOptionset

I try to use it in a CanvasApp. I've imported the Control in my CanvasApp and I've seen that for the bounded property that I've defined in the manifest  (optionsInput)

 

 <property name="optionsInput" display-name-key="Property_Display_Key" description-key="Property_Desc_Key" of-type="OptionSet" usage="bound" required="true" />     
   

 

 i become two properties in the CanvasApp : optionsInput and optionsInput_Options.

I've figured out how to fill the options (by setting optionsInput_Options using Choices function). 

But I don't know how to set the value for optionsInput.

So my PCF control gets all the options

 

 context.parameters.optionsInput.attributes!.Options;

 

BUT the value is always empty.

 

context.parameters.optionsInput.raw;

 

This is my CanvasApp designer:

image.png

 

 

 

3 REPLIES 3
Highlighted
Community Support
Community Support

Re: How to set the value for a PCF Optionset control inside a CanvasApp

Hi @DianaBirkelbach ,

Do you want to specify a value within this OptionSet PCF control through the optionsInput property?

Does the PCF control work well after you specified the Choices formula for the optionsInput_Options property?

 

If you want to set a default value within this OptionSet PCF control through the optionsInput property, please consider take a try with the following workaround:

Set the optionsInput property of the OptionSet PCF control in your app to following:

"A Specific Option from optionsetcode (PCFTesters) field"   // single text value

 

In addition, the Option Set type field provides a set of options. Each option has a number value and label. When added to a form, this field displays a control for users to select only one option. If above formula could not work, please apply the same Choices formula into the optionsInput property.

Set the optionsInput property of the OptionSet PCF control in your app to following:

Choices('optionsetcode (PCFTesters)')

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Skilled Sharer
Skilled Sharer

Re: How to set the value for a PCF Optionset control inside a CanvasApp

Unfortunately I don't get it to work.

I get all available options passed to my PCF control. It works through setting the optionsInput_Options on 

Choices('optionsetcode (PCFTesters)')

When I remove that, I don't get to see any option in my dropdown anymore. 

It doesn't work it I set the this Choices... Formula to the optionsInput

What is missing, is a way to tell my control which value was chosen. I've added the same attribute again on the form by using the standard control (optionsetcode). There you can see on the screenshot that the "Gatekeeper" value is shown as soon I open the form. How can I tell my PCF control which value has to be shown/chosen from the list?

The first solution proposal was not accepted by the from designer.

The second one was accepted by the designer only in combination with "First" function

First(Choices('optionsetcode (PCFTesters)'))

 but it had no effect.

 

When I work with a text area control, I could set the input property value by using

BrowseGallery1.Selected.Textarea

So I thought for the optionset PCF should be something like

BrowseGallery1.Selected.optionsetcode

but unfortunately that is not even accepted by the designer.😞

 

Highlighted
Power Apps
Power Apps

Re: How to set the value for a PCF Optionset control inside a CanvasApp

Hi all,

This appears to be a recent regression in this functionality. We are tracking it internally with priority by internal bug ID 1751868 and hope to have it fixed quickly.

-John

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Users online (7,096)