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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Behavior Events not fi...
Power Apps
Unanswered

Behavior Events not firing in library components

(0) ShareShare
ReportReport
Posted on by 29

I have a component library with a header component that has a button on it. The button OnSelect calls my coponent's OnClick method. In my app where I'm using the component, clicking on the button is not firing the OnClick method recently. This was working before (at least a week or two ago). I don't know if it's caused by a recent power apps release (maybe related to this issue: https://powerusers.microsoft.com/t5/Power-Apps-Experimental-Features/Latest-update-stops-Behavior-Events-accessing-component/m-p/2256007#M643 ?).

 

I can create a component in my Power App and the event fires for that one, but the component in my component library will not fire events (tested with two different components - both don't fire). It's also not showing the correct value of variables (they're always blank in the event expression window. I set ShowMenu to false in App.OnStart, but you can see here it looks like it is Blank:

Power Apps Component Events.png

Categories:
I have the same question (0)
  • rameshmukka Profile Picture
    1,121 on at

    I have similar issue with my component. I am using Patch function, patch doesn't work.

  • jfrenc Profile Picture
    29 on at

    I opened a ticket with Microsoft, and got a disappointing answer. Since behavior properties are "Experimental", they can go away or change how they work at any time. 

  • ShantanuP Profile Picture
    Microsoft Employee on at

    @jfrenc , I was able to repro the issue on our end. We are working on fixing it.

  • jfrenc Profile Picture
    29 on at

    Great, thank you @ShantanuP!

  • ShantanuP Profile Picture
    Microsoft Employee on at

    @jfrenc , Sorry I think I did a mistake in my repro. Now I don't see it repro for me. Can you please provide more details about your scenario?

    Here is what I tried 

    - Create a component in component library

    - Add an event property to component

        Component.CustomProp1 = Notify("Hello")

    - Add a button in component Button.OnSelect = Component.CustomProp1()

    - Import that component to App and click on Button. This works.

  • rameshmukka Profile Picture
    1,121 on at

    We are having multiple patch functions based on several If conditions. Basically used a pop up component where onclick of yes button we are patching relevant details to the data source. Similar patch functions for No and Withdraw buttons. All buttons in single pop-up. We set a flag just before the patch and after the patch. Both flags are set but patch function didn't perform or it may have skipped. Don't know why? This issue is consistent and not intermittent. When we removed component and added buttons on the screen and executed same code, it ran without any problem.

  • jfrenc Profile Picture
    29 on at

    @ShantanuP that's exactly what was not working for me. It had been working before, but stopped. The even property works fine in a component that is in the app, but not in a component library. So I moved my components back into my app to get them working again. As of two days ago, the component library event property was not working for me still. At some point I'll try it again, but I'm just trying to get this done at the moment and don't have time to experiment.

  • ShantanuP Profile Picture
    Microsoft Employee on at

    Can you please share the expression on OnClick so that I can try to repro this on my end?

  • rameshmukka Profile Picture
    1,121 on at

    @ShantanuP 

    I don't have the code now. But its about having multiple patch functions on one of the component Event type properties

  • jfrenc Profile Picture
    29 on at

    @ShantanuP , I'm assuming you're asking me for the expression, since it's my post (RameshMukka, I hope we get it solved for your sake, too).

     

    Here is my definition of the event property:

    Event property definitionEvent property definition

    Here is the OnSelect of the icon in the component.

    Component's Button OnClickComponent's Button OnClick

     

    Here is the app using the component and setting the OnMenuClick event. This fires now that I moved the component back into my app, but it stopped working when the component was in a component library (although it had worked for a couple of months previously):

    Apps component.OnMenuClickApps component.OnMenuClick

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 547

#2
WarrenBelz Profile Picture

WarrenBelz 444 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 322

Last 30 days Overall leaderboard