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

Label Visibility

(0) ShareShare
ReportReport
Posted on by 8

I am new to PowerApps and I'm trying to change a labels visibility using an If statement. If the value in one field is greater than the value in a second but I keep getting the error "This data type is unsupported for evaluation".

 

My If statement: If(ForceCalculation.value > BreakingStrength.value, false, true).

 

Can anyone help a newbie or point me in the direction?

Categories:
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Gingerclaire_ 

    Can you please share more of what your ForceCalculation and BreakingStrength are.

    Are they variables, controls, fields?  

    Are you trying to change a label in a Gallery or just on a screen?

  • Gingerclaire_ Profile Picture
    8 on at

    They are text input fields, one of them had a formula and one is free text, and it’s just on the screen. 

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Gingerclaire_ 

    Very good.  In that case, your formula for the Visible property should be this:

    Value(ForceCalculation.Text) < Value(BreakingStrength.Text)

    This will return a true or false, so there is no need to wrap it in a If statement to then again return a true or false.

    Also notice that I changed your > to < as that would validate the statement properly for a true or false return.

     

    I hope this is helpful for you.

  • Gingerclaire_ Profile Picture
    8 on at

    That’s very helpful thanks! I’ve now got it working how I wanted it to but I have another question.

     

    What do I have to add so it will remain hidden if the BreakingStrength field is left blank?

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Gingerclaire_ 

     

    (Value(ForceCalculation.Text) < Value(BreakingStrength.Text)) && !IsBlank(BreakingStrength.Text)

    This will set the Visible property to true if the ForceCalculation is less than the BreakingStrength  AND that BreakingStrength is not Blank.

     

    Hope that helps. 

  • Gingerclaire_ Profile Picture
    8 on at

    I want to edit it so the statement is true if the ForceCalculation is greater than the BreakingStrength  AND that BreakingStrength is not Blank.

     

    but when I change < to the > symbol it shows the message of the field is blank. Why is it doing that?

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Gingerclaire_ 

     

    Yes, but your logic might be a bit backward.  

    Spell it out first - If the Breaking Strength is specified and the Force Calculation is Greater than the Breaking Strength then the label should be visible.

    Then add operators - If the Breaking Strength is specified (!IsBlank) and (&&) the Force Calculation is Greater (>) than the Breaking Strength then the label should be visible (true).

    Then expand and combine - Visible = (If !IsBlank(Breaking Strength) and (&&) (Value(Force Calculation) (>) Value(Breaking Strength)) true)

    Then simplify and add control names - !IsBlank(BreakingStrength.Text) && (Value(ForceCalculation.Text) > Value(BreakingStrength.Text))

    Then prove - 

     Force Calculation    Breaking Strength    IsBlank   Formula Substitute                        Simplified               Result

              1                                1                    false       !false(true) && (1 > 1) (false)       true && false =     false (not visible)

              2                                1                    false       !false(true) && (2 > 1) (true)        true && true =      true (visible)

              1                                2                    false       !false(true) && (1 > 2) (false)       true && false =     false (not visible)

              2                                                      true        !true(false) && (2 > 0) (true)        false && true =     false (not visible)

              0                                                      true        !true(false) && (0>0) (false)         false && false =    false (not visible)

     

     

    See if that is in fact what you are looking for. 

     

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 239

Last 30 days Overall leaderboard