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 / IF condition using Not...
Power Apps
Answered

IF condition using Not equal to <>

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

I would like to disable a button if the text in TextInput1 is not equal to "Y".

I tried using: If(TextInput1.Text <> "Y" || TextInput1.Text <> "y", DisplayMode.Disabled, DisplayMode.Edit)

but it doesn't seem to work. How could I better approach this?

 

Thank you!

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

    @Anonymous 

    Please consider changing your Formula to the following:

    If(!(Upper(TextInput1.Text) = "Y"), DisplayMode.Disabled, DisplayMode.Edit)

     

    This converts to Upper so you only need one condition and it also performs a ! (Not) on it to give the inequality.

     

    I hope this is helpful for you.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Awesome, thank you @RandyHayes ! it worked!

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

    @Anonymous 

    🤣🤣 Oh my - Apparently I look at PowerApps formulas way too much.  When I first read your response I though..."Oh no, it's not working".   Why did I think this? Because I saw "! it worked"  My mind immediately took that as "NOT it worked".  Now I see that was the end of the first sentence!!

    🤣😂

    I am glad it worked for you!

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    😂🤣Haha! you're a wiz @RandyHayes but take a break sometimes.

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

#2
WarrenBelz Profile Picture

WarrenBelz 202 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard