cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

PowerApps Button Color Change on Form Load

I've seen posts similar, but we have 1 screen with 3 forms on the one screen.  Patch wasn't working, so this ensures all data is posted.  

 

Form Name / Button Name:

 

Main / Main

AddInfo / Additional Information

Status / Status

 

When a form is loaded, I want the button that corresponds to the title to display a different color.  For example, if user clicks button "Main" - I want the Main button to change color, and keep that color, until another button is clicked.  This will help users know which form they are viewing/editing.  

 

The buttons are currently configured with 

 

 

OnSelect:    Set(ShowMainForm,true);Set(ShowAddInfoForm,false);Set(ShowStatusForm,false)

 

 

 

TIA

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Continued Contributor
Continued Contributor

Re: PowerApps Button Color Change on Form Load

You change the fill and/or color property of the button if the corresponding form is showing.  

If(ShowMainForm, Green, Red)
If(ShowAddInfoForm, Green, Red);
If(ShowStatusForm, Green, Red);

 Put the formula on corresponding button's fill and/or color property. You can change colors however you like. 

View solution in original post

5 REPLIES 5
Highlighted
Continued Contributor
Continued Contributor

Re: PowerApps Button Color Change on Form Load

You change the fill and/or color property of the button if the corresponding form is showing.  

If(ShowMainForm, Green, Red)
If(ShowAddInfoForm, Green, Red);
If(ShowStatusForm, Green, Red);

 Put the formula on corresponding button's fill and/or color property. You can change colors however you like. 

View solution in original post

Highlighted
Frequent Visitor

Re: PowerApps Button Color Change on Form Load

Hi @ZabiBabar ,

 

If I add to button Color or Fill, I get errors expecting operator + & *  at the semi-colons and commas

Highlighted
Continued Contributor
Continued Contributor

Re: PowerApps Button Color Change on Form Load

Sorry for the miscommunication. You should not add all three formulas to one button. One formula corresponds to one button.

Main Button Fill/Color: If(ShowMainForm, Green, Red)
Additonal Button Fill/Color: If(ShowAddInfoForm, Green, Red);
Status Button Fill/Color: If(ShowStatusForm, Green, Red);
Highlighted
Frequent Visitor

Re: PowerApps Button Color Change on Form Load

@ZabiBabar - Thank you.  That works.  How do I reference specific colors, like:

 

BLUE RGB:  

0   153   204

 

#0099CC

Highlighted
Helper II
Helper II

Re: PowerApps Button Color Change on Form Load

Button_Name.Color= RGBA(0, 153, 204, 1);

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,377)