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 / Text input with number...
Power Apps
Answered

Text input with numbers only

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

 

I would like to make my text input box only accept 6 digit numbers only. Additionally, I would also like to make it so that whichever 6 digit number that is entered is looked up in reference to the SharePoint list that is connected to my app. I am not sure how to go about that. After this number is looked up, a pop-up should occur letting the user know that the number they entered was found in the records.

 

Thank you

Categories:
I have the same question (0)
  • vaubeee Profile Picture
    533 Microsoft Employee on at

    Hi! I assume you are speaking about a canvas app. You could set the txt input properties as follows:

    Format: Number

    MaxLength: 6

    Hint Text: "Input 6-digit number"

    OnChange - due to lack of infos, just a basic logic 🙂 :

    If(

    Value(Self.Text) = *yourDataSourceColumn*.Value,

    Notify("Number already used",NotificationType.Information),

    Patch()

    )

     

    ------------------------------------------------------------------------------------------------------------------------------
    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.

  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    I've made a test for your reference:

     

    Set the text input control's Default property to:

    "000000"

    Set it's OnChange property to:

    If(
     !IsMatch(Self.Text,"\d{6}"),
     Reset(Self);Notify("input box only accept 6 digit numbers only"),
     If(
     !IsBlank(DataSource,ColumnName=Self.Text)),
     Notify("number was found"),
     Notify("number not found")
     )
    )

     

    Best Regards,

    Bof

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 502

#2
Vish WR Profile Picture

Vish WR 454

#3
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

Last 30 days Overall leaderboard