web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to set the value f...
Power Apps
Unanswered

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

(0) ShareShare
ReportReport
Posted on by 3,072 Most Valuable Professional

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

 

 

 

I have the same question (0)
  • v-xida-msft Profile Picture
    on at

    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,

  • Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on at

    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.😞

     

  • jolake Profile Picture
    on at

    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

  • Jose Ramon Profile Picture
    107 on at

    I'm having the same problem, did you find the solution?

  • Community Power Platform Member Profile Picture
    on at

    Has this been solved yet? I could not find the bug @jolake mentioned.

     

    I am trying to make a custom dropdown which will return the selected option of the optionset so it can be used in the canvas app and that works, but the optionsProperty (not optionsProperty_Options) field does not corespond to the control. How is it meant to be used and connected (working with a react control I tried having a state and props property that should update each other, but this didn't work)?

  • Community Power Platform Member Profile Picture
    on at

    Is there any update on this @DianaBirkelbach @jolake ?
    I would like to be able to set a default selected option for a dropdown I am creating, and in the testharness it works, but in PowerApps, Choices.raw is null.

    Britninja_0-1685661390524.png


    I also feel like many people are confused on how to use the optionset... Maybe someone can give a better explanation?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard