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 / Buttons form component...
Power Apps
Unanswered

Buttons form component not working

(0) ShareShare
ReportReport
Posted on by 61

I started with a blank app.

I want two buttons on the app. When you click the one called Plan, it will set a variable called varButtonPlan to true and the variable called varButtonDesign to false. When you click the other button called Design, it will do the same, but with varButtonPlan as false and varButtonDesign as true. 

 

To the screen, I added two buttons useing this code in OnSelect

 

varButtonPlan

Set(varButtonPlan, true);
Set(varButtonDesign, false)

 

varButtonDesign

Set(varButtonPlan, false);
Set(varButtonDesign, true)

 

To see if it worked, I added two text labels, one with each variable.

 

Works perfect!

 

I want to create these buttons in a component to add them to screens as needed. 

I created them the exact same way in the component; however, when I added the component to the screen, the buttons did not work. 

 

I tried to initialise the variables with the following code and tried this on both App - OnStart and Screen - On Visible.  It still did not work. 

Set(varButtonPlan, false);
Set(varButtonDesign, false)
 
Any ideas on why the buttons are not working when coming from a component? 
 
Thanks, 

 

Categories:
I have the same question (0)
  • mmbr1606 Profile Picture
    14,629 Super User 2026 Season 1 on at

    hey @EricSara77 

     

    can u try this:

     

    For the Plan button
    Set(OutputPlan, true);
    Set(OutputDesign, false);
    
    For the Design button
    Set(OutputPlan, false);
    Set(OutputDesign, true);
    

     

    Assuming your component is named MyComponent

     

    
    Set(varButtonPlan, MyComponent.OutputPlan);
    Set(varButtonDesign, MyComponent.OutputDesign);
    

     

    app onstart:

     

    Set(varButtonPlan, false);
    Set(varButtonDesign, false);
    

     

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

     

     

  • EricSara77 Profile Picture
    61 on at

    Thanks for this @mmbr1606 

    Just looking to clarify where to enter this

     

     

    Set(varButtonPlan, MyComponent.OutputPlan);
    Set(varButtonDesign, MyComponent.OutputDesign);

     

     

     

    And confirming that I have the following correct. 

     

    For the Plan button
    Set(OutputPlan, true);
    Set(OutputDesign, false);
    
    For the Design button
    Set(OutputPlan, false);
    Set(OutputDesign, true);

    This will be on the OnSelect for each button

     

    and

    Set(varButtonPlan, false);
    Set(varButtonDesign, false);

    this will be on app start as you have detailed. 

     

    Cheers, 

  • mmbr1606 Profile Picture
    14,629 Super User 2026 Season 1 on at

    you can put this in the onvisible of screen:

    Set(varButtonPlan, MyComponent.OutputPlan);
    Set(varButtonDesign, MyComponent.OutputDesign);

     

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

  • EricSara77 Profile Picture
    61 on at

    Hi @mmbr1606 

    I feel I am doing this wrong. 

    I have the component, and it is called SideMenu I have set the Plan button as per the screenshot

    EricSara77_0-1716533228541.png

     

    Then, on the Screen / OnVisable, I have it how I think you said to. 

    EricSara77_1-1716533302337.png

    Then on the App I have it how I thin you said to 

    EricSara77_2-1716533329897.png

     

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 345 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 177

Last 30 days Overall leaderboard