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 / Visible text box using...
Power Apps
Answered

Visible text box using an If statment and Update Context to make unvisible despite true (images Code etc)

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

My app has an text input button (numeric only) that a user puts in a number, if that number is bigger than 24 i have an image, text box and a button (the X) shows the following image

 

111.png

 

however i need for the button to ignore the If statment and close the image despite the If statment being true. Its more of a warning system as the number should never exceed 24 unless someone before them put in the incorrect value

 

The image, text box and button visible code is 

If(Value(Can_SMU.Text) > Value(ASS_SMU.Text) + 24, true, false)

 

What code do i put into the onselect of the X button?

 

Categories:
  • Verified answer
    mdevaney Profile Picture
    29,993 Moderator on at
    @Anonymous
    My idea would be to put this code in the OnChange property of your text input instead

    If(Value(Can_SMU.Text) > Value(ASS_SMU.Text) + 24, Set(showWarning, true))

    Then change the Visible property of the warning to

    showWarning

    Finally, put this code in the OnSelect property of the X button to make the menu hide when pressed

    Set(showWarning, false)

    —-
    Please Accept as Solution if this post answered your question so others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thankyou i did more or less the same, except i used context variables.

  • mdevaney Profile Picture
    29,993 Moderator on at
    @Anonymous
    I’m glad it worked. Best of luck in building your app.

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 323

#3
Mohsin Ali Profile Picture

Mohsin Ali 226

Last 30 days Overall leaderboard