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 / Change color of button...
Power Apps
Unanswered

Change color of button if all fields of a Detail Form are filled

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello, 

 

I have a PowerApp with different Detail Forms that I can be accessed with buttons. As soon as a form has been filled with the needed Information, the button should get the color green. If only half of the form is filled out, it should be orange, and if there is no data than the button should be red. 

 

How could something like this work? 

 

Many thanks in advance for your help.

Categories:
  • Feiteira Profile Picture
    199 on at

    Hi there @Anonymous ,

     

    The Green and Red are easy to do, but the Orange one is more tricky and to be honest, althought I don't really like this solution, it does work.

     

    In my case, I have just two fields which are required and so, we have the following code on the Fill property of the Button.

    If(
     Form1.Valid,
     Green,
     If(
     And(
     IsBlank(DataCardValue1.Text),
     IsBlank(DataCardValue6.Text)
     ),
     Red,
     Orange
     )
    )

    Feiteira_0-1665490417147.png

     

    Having all fields filled:

    Feiteira_1-1665490459162.png

     

     

    Having none of the fields filled:

    Feiteira_2-1665490512232.png

     

     If someone has a suggestion about the Orange condition, I would also like to try it as this one works but does not seem a good practice.

     

    Hope this will help you.

     

    Don't forget to give it the Kudos and "Accept it as solution" if it works out for your case 😀

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi, 

     

    thank you very much for your fast response. Unfortunately, PowerApps gives me the error message "Valid is not recognized. I live in Germany, could it be a country specific problem? 
    And do I have to differentiate between text fields and selection fields?

     

  • Feiteira Profile Picture
    199 on at

    Can you share some prints from your components?

    We might be using different components as TextInput vs Dropdown

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I have more DropDown fields than Textinput fields 

  • Feiteira Profile Picture
    199 on at

    Well, the idea is the same, instead of using DataCardValue1.Text , use Dropdown1.Selected.Value for each Dropdown you need.

     

    Can you share the Form? Maybe we can figure out why you don't have the Form1.Valid property

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    powersebb11_0-1665496653167.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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 223

Last 30 days Overall leaderboard