Skip to main content

Notifications

Community site session details

Community site session details

Session Id : pas4tnKegjjKDleYd8/l8j
Power Apps - Building Power Apps
Answered

Text input with numbers only

Like (0) ShareShare
ReportReport
Posted on 6 Sep 2023 13:20:32 by

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

  • Verified answer
    v-bofeng-msft Profile Picture
    on 07 Sep 2023 at 06:44:20
    Re: Text input with numbers only

    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

  • vaubeee Profile Picture
    533 on 06 Sep 2023 at 14:01:51
    Re: Text input with numbers only

    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.

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 211 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 108

#3
stampcoin Profile Picture

stampcoin 80

Overall leaderboard
Loading started