cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Patron
Post Patron

Error message

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User II
Super User II

Re: Error message

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

View solution in original post

4 REPLIES 4
Highlighted
Super User II
Super User II

Re: Error message

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

View solution in original post

Highlighted
Super User III
Super User III

Re: Error message

 
Highlighted
Post Patron
Post Patron

Re: Error message

@GarethPrisk 

 

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

Highlighted
Super User II
Super User II

Re: Error message

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)

 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Come join us today! 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 (3,316)