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 / Label Colour if Blank
Power Apps
Answered

Label Colour if Blank

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

I think this is a simple one but can't figure it out. 

 

I have a Label in a gallery showing the Weight, using the code ThisItem.'Final Dryer Cleaning Waste'.

 

Then depending on that number, I am changing the Fill Colour of the label using the code  below:

If(
 Value(Self.Text) < 300,
 Color.LimeGreen,
 Value(Self.Text) < 351,
 Color.Orange,
 Color.Red
)

 

However, when the Label is blank because no Weight has been submitted, the Label is Lime Green as it is following the code above (less than 300). But I just want the Label to be white if it is blank, or even better if it could say 'No Weight Submitted' when it is blank.

 

Any help is much appreciated.

Thanks 

Categories:
I have the same question (0)
  • Verified answer
    Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    Hi @Anonymous ,

     

    On the Fill property of the Label, try:

     

    If(
     Len(ThisItem.'Final Dryer Cleaning Waste') = 0,
     Color.White,
     If(
     Value(Self.Text) < 300,
     Color.LimeGreen,
     Value(Self.Text) < 351,
     Color.Orange,
     Color.Red
     )
    )

     

    On the Text property, try:

     

    If(
     Len(ThisItem.'Final Dryer Cleaning Waste') = 0,
     "No Weight Submitted",
     Text(ThisItem.'Final Dryer Cleaning Waste')
    )

     

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks @Amik ,

     

    That works absolutely perfectly!

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 491

#2
WarrenBelz Profile Picture

WarrenBelz 407 Most Valuable Professional

#3
11manish Profile Picture

11manish 331

Last 30 days Overall leaderboard