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

Community site session details

Session Id : 50FxUYoj3aEtkQCrOZ1clY
Power Apps - Building Power Apps
Answered

Create a Button Component that has a property for OnSelect

Like (1) ShareShare
ReportReport
Posted on 1 Mar 2019 18:34:26 by

I am working on an app and have been implementing the new Components feature. I am trying to create a button Component that will allow me to control the look of the button and allow me to modify the OnSelect property of the button control with a 'created property' in the Custome Component, but it is not working. I get a formule error. 

 

Capture1.PNG

Does anyone have any thoughts on how to make this work. maybe I have the wrong data type selected. I have text select at the moment but I have tried others.

I have the same question (0)
  • Aionik Profile Picture
    103 on 14 Mar 2023 at 13:25:59
    Re: Create a Button Component that has a property for OnSelect

    Any Update on this? How is this not imported in planned phase 2 years. I can't use Update/Patch etc. on my Button Component. It seems that the feature irrelevant without it.

  • CW Profile Picture
    1,042 on 01 Mar 2021 at 03:40:00
    Re: Create a Button Component that has a property for OnSelect

    Thanks Randy. Yes, I just saw that email in my notifications.

     

    CW

  • mdevaney Profile Picture
    29,987 Moderator on 01 Mar 2021 at 02:01:41
    Re: Create a Button Component that has a property for OnSelect

    @RandyHayes @Anonymous 
    Good news Randy, Power Apps canvas components now have behavior type properties which enable the use or OnSelect, OnChange and more!  You can check out how I got it working in the article below.

    Link to Article:
    https://matthewdevaney.com/power-apps-component-with-an-onselect-property/

     

    powerapps-componentonselect-1.gif

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • CW Profile Picture
    1,042 on 14 Jan 2021 at 19:35:52
    Re: Create a Button Component that has a property for OnSelect

    So it's currently January 2021. This is still not available????????????????? Oh I forgot they had to clean up connections to Trello. 

  • RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on 13 Mar 2019 at 19:19:33
    Re: Create a Button Component that has a property for OnSelect

    @Anonymous 

    Right...because you are trying to do a behavior statement in a text field.  You can't do that!

    There is no current way to create an Action on a Component.  You can handle actions within the component, but the component cannot interact with items outside of the component.  Your component can change properties within it (output parameters),  and you can set properties from outside it (input parameters), but you do not currently have an Action parameter.  So there is no way for it to "raise" an action where you could put a behavior formula like you have.

    Again...vote for this in the ideas forum.

    This would be the only way you could do that.  Otherwise, you have to do some seriously clunky methods inside of your hosting screen to "monitor" the values of the parameters and act on them if they change - sounds easy enough, but it's a nightmare and, at the end of the day, it would have been easier to just maintain the "component" as separate controls rather than make a component.

    Go vote!!

  • Verified answer
    RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on 05 Mar 2019 at 15:31:46
    Re: Create a Button Component that has a property for OnSelect

    @Anonymous 

    Not at this time...PLEASE vote for it here
    It would REALLY make Components shine.  Because I believe a lot of people will be trying to make components of "common screen elements" and often, common screen elements will be Menus, PopUp boxes, and other items that NEED an OnSelect or other definable Action.

  • Community Power Platform Member Profile Picture
    on 05 Mar 2019 at 12:59:54
    Re: Create a Button Component that has a property for OnSelect

    @Mr-Dang-MSFT

     

    So it is not possible to set up a component that is a button, or an icon, and have the 'OnSelect' action be in or comprised of a custom property?

  • Mr-Dang-MSFT Profile Picture
    on 04 Mar 2019 at 19:40:45
    Re: Create a Button Component that has a property for OnSelect

    Echoing @RandyHayes, you can't place actions where they would not belong.

     

    Components do not have a custom property for behaviors like OnSelect today, but you can still change the behaviors of controls within the component to do the actions you want.

  • RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on 01 Mar 2019 at 20:27:56
    Re: Create a Button Component that has a property for OnSelect

    @Anonymous 

    Right, so in this case you are trying to do a Set in a text property...which is not allowed or valid.

    There is no concept currently of "raising actions" from your components.

    You would need to wire it up differently - in my case I used a toggle on the screen the component was embedded in to simulate the Action being raised.  But it was less than ideal and really broke the "portability" concept of the component.

    Incidentally, I have an Idea in the idea forum for exactly this feature.  Please check it out and Vote on it.

  • Community Power Platform Member Profile Picture
    on 01 Mar 2019 at 19:37:30
    Re: Create a Button Component that has a property for OnSelect

    @RandyHayes ,
    I created a Component called 'BtnLrg', in it I created a custom property called 'Action' with a data type of 'Text'. I then added a button control to the component and in the 'OnSelect' properter I enter the sytax 'BtnLrg.Action'.  

     

    BtnLrg.Action

    Then when the component is added to the screen; I set the 'Action' property to 'Set(VarTestFilter,true);Set(VarInspSelectDisable,DisplayMode.Disabled)'

    Set(VarTestFilter,true);Set(VarInspSelectDisable,DisplayMode.Disabled)

    and that is when I get the error. I think I am misunderstanding something or just missing something.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Loading complete