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 / Is it possible to trig...
Power Apps
Suggested Answer

Is it possible to trigger a Power Apps formula once a button in a code component is clicked?

(0) ShareShare
ReportReport
Posted on by 457
Greetings, community. I'm working on a code component and am wanting to configure it in such a way that a button clicked in the component will output a number and trigger Power Apps code that a maker sets in the Power Apps Editor. Can anyone help point me in the right direction to find more info on how to do this?
 
I'm thinking of the same event/action properties in standard Power Apps components that let app makers define the PowerFX code that gets run and the component can trigger it.
 
Not sure if the attached visual can be accessed or not (couldn't insert a picture directly for some reason), but that visualizes this process.
Code Component Demo.png
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,960 Moderator on at
    Hi
     
    If I might ask, does this have to be a Code Component? Can it just be a Canvas App Component? In which case it would be super easy.
     
    1. Create the Component
    2. Add an Event
    3. In the Button , call the event, passing it data or whatever you want
    4. Click to your UI (screen)
    5. Find the Component and select it
    6. Click the Drop down in the top left for its Properties, you will see the Event
    7. Do whatever you want on the App Side and you simply access the data based on the Parameter Name you passed
     
    Will this work?
  • arpost Profile Picture
    457 on at
    @FLMike, thanks for the reply. This does indeed need to be a code component as I am working to actually create my own version of the HTML component so that I can have HTML elements (e.g., spans) emit data based on clicks. This behavior can't be achieved with any existing controls in native Power Apps.
  • Suggested answer
    Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on at
    Hi @arpost, 
     
    You could use a bound or output PCF property for that. If you change that value (call notifyOutputChanged), you trigger an OnChange event in PowerApps, where you can define PowerFx formulas to do the work. 
    Another approach is to define some custom events. 
     
    Hope it helps!
    Diana
  • Suggested answer
    CU30071006-2 Profile Picture
    8 on at

    Yes, you can trigger a Power Apps formula from a button in a code component by using the `notifyOutputChanged` method in your component code. You’ll need to set up the Power Apps formula to handle the event when it receives data from the component. Check the Power Apps component framework documentation for details on how to configure this.
  • Suggested answer
    CU30071006-2 Profile Picture
    8 on at

    Yes, you can trigger a Power Apps formula from a button in a code component by using the `notifyOutputChanged` method in your component code. You’ll need to set up the Power Apps formula to handle the event when it receives data from the component. Check the Power Apps component framework documentation for details on how to configure this.

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!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 545 Most Valuable Professional

#2
Haque Profile Picture

Haque 314

#3
Kalathiya Profile Picture

Kalathiya 234 Super User 2026 Season 1

Last 30 days Overall leaderboard