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 / PowerApps First Charac...
Power Apps
Answered

PowerApps First Character <> 8

(0) ShareShare
ReportReport
Posted on by 233

Hello,

I have a textinput field called TextNumber.

I need to throw a message if they start entering a number that starts with an 8 and disable Button1.

Thank you in advance!

Categories:
  • Verified answer
    SebS Profile Picture
    4,867 Super User 2026 Season 2 on at

    Hi @kbashaw 

     

     

     

    To disable the button, place the below code to DisplayMode property of the button

     

     

    If(IsBlank(Find(8,TextNumber.Text,1)),DisplayMode.Edit,DisplayMode.Disabled)

     

     

    Now the issue is with the message. You can trigger it only when the User finishes typing using the OnChange property.

     

    Here is code for OnChange

     

     

    If(IsBlank(Find(8,TextNumber.Text,1)),"",Notify("Warning Message",NotificationType.Warning))

     

     

    Another option is a label where in the Text  property, You will place the:

     

     

    If(IsBlank(Find(8,TextNumber.Text,1)),"","Warnning Massage")

     

     

    Cause warning massage-like Notifications can be only triggered when text is submitted

     

  • kbashaw Profile Picture
    233 on at

    THANK YOU!

    I appreciate the different variations you gave me too! 

    I did have to change this:

    If(IsBlank(Find(8,TextNumber.Text,1)),"","Warnning Massage")

    to 

    If(IsBlank(Find(8,TextNumber,1)),"","Warnning Massage")

    It wouldn't take the .Text

    Thank you again for your help!

  • kbashaw Profile Picture
    233 on at

    I found a bug with the solution code. It's not searching for the first character position. For example: The error message and button need to be disabled if they enter an 8 only in the first position. That works, however, if they enter 58, the button is disabled, and error message appears. 58 would be a valid number, 85 would not be.

    Thoughts?

  • Verified answer
    SebS Profile Picture
    4,867 Super User 2026 Season 2 on at

    @kbashaw 

     

    You are right.

     

    Change the formulas for the label:

     

     

    If(IsBlank(Find(8,Left(TextNumber.Text,1),1)),"","Warnning Massage")

     

     

     And for the button:

     

     

    If(IsBlank(Find(8,Left(TextNumber.Text,1),1)),DisplayMode.Edit,DisplayMode.Disabled)

     

  • kbashaw Profile Picture
    233 on at

    Thank you! That fixed it for me.

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard