cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AdamW
Helper III
Helper III

Need help with If statement when IsBlank is included

I am trying to change the color of a form field based on the value of the field.  The If statement below works for part of what I need.  I also want the form to have no fill if the field is blank but I am struggling with how to properly combine the IsBlank function.  Can anyone please help?

 

If(DataCardValue3.Text = "Success",varAccentColorSproutLightGreen,Red)

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @AdamW ,

Try

Switch(
   DataCardValue3.Text,
   Blank(),
   Transparent,
   "Success",
   varAccentColorSproutLightGreen,
   Red
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

View solution in original post

2 REPLIES 2
WarrenBelz
Super User
Super User

Hi @AdamW ,

Try

Switch(
   DataCardValue3.Text,
   Blank(),
   Transparent,
   "Success",
   varAccentColorSproutLightGreen,
   Red
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

Thank you!  Works pefect!

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (2,578)