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 / field color change bas...
Power Apps
Answered

field color change based on date

(0) ShareShare
ReportReport
Posted on by 48

I am altering a power app that I did not build.  Fun Right?

 

I have a date picker field called license expiration date that needs to change color to orange 60 days prior to the expiration date and then to red one week prior to expiration date.


I am far from a coder, but would appreciate any help you can offer! How to make the text in center of a inserted Table and border color 

 

Categories:
  • Michael E. Gernaey Profile Picture
    53,975 Super User 2026 Season 2 on at

    Hi @AHILLCC 

     

    Need some more information. I was going to answer then looked at the link which is talking about an HTML table. Are you building an HTML Table???

    Or is this just a field in your app that people will see??

     

    Changing the Color, which means

    1. The Fill

    2. The Color (this is the font color) and may need to change if the fill (aka green/yellow/red background of the field over does the font color.

     

    The way you explain it though, you say the Date Picker needs to change colors?? or a field that represents the date that holds the value of Expiration Date??

     

    Are these modern or classic controls?


    If I have helped you, I would really appreciate if you please Mark my answer as Resolved/Answered, and give it a thumbs up, so it can help others

    Cheers

    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

  • AHILLCC Profile Picture
    48 on at

    Thanks, Michael.  I'm sure my information is very confusing, and I apologize.  I've answered your questions in bold caps below, and I hope it offers some clarification!  Any info you can give would be greatly appreciated!

     

    Changing the Color, which means EITHER IS FINE, AS LONG AS THE COLOR IS VIEWABLE BY THE USER

    1. The Fill

    2. The Color (this is the font color) and may need to change if the fill (aka green/yellow/red background of the field over does the font color.

     

    The way you explain it though, you say the Date Picker needs to change colors?? or a field that represents the date that holds the value of Expiration Date?? A FIELD THAT REPRESENTS THE DATE THAT HOLDS THE VALUE OF LICENSE EXPIRATION DATE - SO ESSENTIALLY, THE USER WOULD ENTER A DATE IN THE "APP" WHICH IS REALLY JUST A FANCY LIST.  IF THE ENTERED DATE IS WITHIN 60 DAYS OF TODAY, THE DATE THEY ENTERED WOULD TURN ORANGE.  IF THE ENTERED DATE IS WITHIN A WEEK OF TODAY, THE DATE THEY ENTERED WOULD TURN RED.

     

    Are these modern or classic controls? I'VE TRIED IT IN CLASSIC AND THE MODERN, SO I'M OPEN TO EITHER.

  • Michael E. Gernaey Profile Picture
    53,975 Super User 2026 Season 2 on at

    @p34t34  perfect explanation 

     

    Bear with me can only use one hand atm and Dictate is broken ill explain how

  • Verified answer
    Michael E. Gernaey Profile Picture
    53,975 Super User 2026 Season 2 on at

    @AHILLCC 

     

    In the Fill and Color Properties do this. Now the list part, not sure if its a real list, gallery or dropdown etc control

     

    But Example of the fill of  text label based on typing in a date in a text input.  I use the DateValue to convert the entered text to a Date.

     

    So you just need to substitute my TextInput1 with your selected list item.

    Note you may want to add this to the Color property but change the colors to be readable

    another option is use the border color instead of fill

    If(DateDiff(DateValue(TextInput1.Text), Today()) <= 7, Color.Red,
     If(DateDiff(DateValue(TextInput1.Text), Today()) <= 60, Color.Orange,
     Color.Green
     )
    )
    

    FLMike_0-1707420986144.png


    If I have helped you, I would really appreciate if you please Mark my answer as Resolved/Answered, and give it a thumbs up, so it can help others

    Cheers

    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

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 234 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 169

Last 30 days Overall leaderboard