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 Apps
Answered

Error message

(0) ShareShare
ReportReport
Posted on by 792

Hi Community people 🙂

I have date picker where I have set the border colour to change and a label to be visible when a date is selected in the past, however this highlights and shows when the value within the card is blank. 

 

The border code I have is If(DataCardValue24.SelectedDate < DatePickerToday.SelectedDate, Color.Red, RGBA(101, 128, 187, 1))

 

I don't want the card value to be set as default today, therefore my ideal solution would be if DataCardValue24 is blank() set the border to RGBA(166,166,166,1).

 

Can anyone suggest how to add this to the above code?

Categories:
  • Verified answer
    GarethPrisk Profile Picture
    2,828 on at

    You can nest If statements, so the app processes them in logical order. Yours would check for a blank value first, then process it once it has a value. Something like:

     

    If(

    IsBlank(DataCardValue24.SelectedDate),

    RGBA(166, 166, 166, 0),

    DataCardValue24.SelectedDate < DatePickerToday.SelectedDate,

    Color.Red,

    RGBA(101, 128, 187, 1)

    )

     

    This is now basically structured as If, ElseIf, Else

  • eka24 Profile Picture
    20,925 on at
  • Kmayes Profile Picture
    792 on at

    @GarethPrisk 

     

    Thanks Gareth this works, if I want to add an additional if condition say DataCardValue41.SelectedDate = DatePickerToday2.SelectedDate, can this be incorporated?

  • GarethPrisk Profile Picture
    2,828 on at

    Sure! Just add it to the If statement in the logical location. These are typically written as If( X , true , false ), but does support multiple Ifs as we outlined in the previous post 

     

    If (

    X,

    True (X)

    Y,

    True (Y),

    Z,

    True (Z),

    False (X,Y,Z)

    ) 

     

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 325

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard