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 / Conditional border col...
Power Apps
Unanswered

Conditional border color using If( statement

(0) ShareShare
ReportReport
Posted on by 6

I have a large form with many dropdowns and combo boxes. I have successfully set each (except for a couple) to have a red border if they're blank and a black border if they contain a selection.  

 

The ones I'm having issues with are HourValue and MinuteValue dropdown fields. For all other fields I have been able to use the below code to achieve my goal: 

If(
    IsBlank(DCV122.Selected) ,
    Color.Red,
    Color.Black  
)
 
However, when I use the following for my HourValue and MinuteValue dropdown fields, the conditional border color does not work. I don't get an error message, the border just remains black.
If(
    IsBlank(HourValue1.Selected),   //Note: I have also tried .Selected.Value
    Color.Red,
    Color.Black  
)

I believe the issue is because the field is not truly blank even when no selection has been made. It appears that Date and Time fields from SharePoint lists just create dropdowns that have hard coded choices in the "Items" property--for example, the "Items" property of the HourValue dropdown is  ["00","01","02","03"], etc.

So, my question--how can I achieve my desired outcome (red border by default, but black border once a selection has been made) with something other than an If( statement? Or is there a different If( statement I can use? Thank you!
Categories:
I have the same question (0)
  • AldenKnibbs Profile Picture
    107 on at

    Have you tested the following?

    If(
        DCVTimeOrMinute.Selected = 0 ,
        Color.Red,
        Color.Black  
    )
  • daheld Profile Picture
    6 on at

    Thanks for this. I'm an idiot. It was that simple. Of course.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 84

#2
WarrenBelz Profile Picture

WarrenBelz 79 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 40 Super User 2026 Season 1

Last 30 days Overall leaderboard