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 / Trouble using OnSelect...
Power Apps
Suggested Answer

Trouble using OnSelect custom property in Component (Power Apps v3.25082.8)

(1) ShareShare
ReportReport
Posted on by 16

Hi everyone,

 

I created a canvas component in Power Apps and added custom properties for reusability:

I created a canvas Button component (A container, Image and Text Label) in Power Apps A Text property for a label (works fine), An Image property for an image control (also works fine) and added an OnSelect custom property. I want to trigger actions (like Navigate(...) or Set(...)) from this component when its internal button is clicked.

Here’s what I tried so far:

  • I added a custom property named OnSelect.

  • I first set it as a Text input → got the error “Behavior function in a non-behavior property”.

  • I then changed it to Action with ReturnType: None, and in the button’s OnSelect I used: Component_Button.OnSelect().

But I still get the same error.. I’m on Power Apps version v3.25082.8. In the custom property types, I only see Data, Function, Event, Action. Which one should I use for a proper OnSelect event in a component, and how should it be wired up inside the component?

​​​​​​​Thanks in advance for any guidance!

Categories:
I have the same question (0)
  • Suggested answer
    Robu1 Profile Picture
    1,621 Super User 2026 Season 1 on at
     
    Thank your for choosing Power Platform Community.

    Problem: You want a reusable component (e.g. a button) to trigger actions like Navigate(...) or Set(...) when clicked, using a custom OnSelect property.
     
    Incorrect Attempts:
    Setting OnSelect as a Text property → error: “Behavior function in a non-behavior property”.
    Setting it as Action with ReturnType: None → still triggers the same error.
     
    Correct Approach:
    Enable Enhanced Component Properties in Power Apps settings (under Experimental features).
    Create the OnSelect property as a Behavior type.
    Inside the component, set the internal button’s OnSelect to:
    powerapps
    ComponentName.OnSelect()
     
    When using the component in your app, assign any valid action to OnSelect, like:
    powerapps
    Navigate(Screen2)

    This setup allows your component to execute external actions when clicked, making it fully reusable and behavior-driven.
     
    Check out these resources:
     
    If this fixes the issue, please mark as resolved to help others with find it.
    Happy to help 
    Robu1
    SuperUser|Moderator
    Season 2:2025
  • Suggested answer
    Power Platform 1919 Profile Picture
    2,205 Super User 2026 Season 1 on at
    Hi ,
    Let me explain few things about component,
    1. Make sure to enable Enhanced Component Properties:

    2. Understanding the Property Type:

    🔹 Component Property Types in Power Apps

    1. Data

    • Purpose: Used to send or receive values between the app and the component.

    • Think of it like: Passing parameters in/out.

    • Example: A header component → App sets HeaderTitle property → Component displays it.


    2. Function

    • Purpose: Allows the app to call a function defined inside the component.

    • Think of it like: A built-in function (e.g., Sqrt()), but your own.

    • Example: App calls GetSquareRoot(9) → Component returns 3 → App can consume it via a Data property.


    3. Event

    • Purpose: Lets the component trigger an event that the app can handle.

    • Think of it like: The OnSelect property of a button.

    • Key Point: The property is exposed in the app → App maker writes logic to respond.

    • Example: Inside a component, a "Submit" button triggers OnSubmit → In the app, developer writes logic in Advanced Properties to save data.


    4. Action

    • Purpose: Defines a function with parameters and logic that changes state (side effects).

    • Key Difference from Event:

      • Event = Exposed → app writes the logic.

      • Action = Logic stays inside component → app just calls it.

    • Example: A "ResetForm" Action property → App calls MyComponent.ResetForm() but the reset logic is defined inside the component and not editable outside.

    And for this use case, you have to use Event Property Type.
     

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 548

#2
WarrenBelz Profile Picture

WarrenBelz 408 Most Valuable Professional

#3
Haque Profile Picture

Haque 309

Last 30 days Overall leaderboard