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 / 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 455
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.
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,433 Super User 2025 Season 2 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
    455 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

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard