Skip to main content

Notifications

Community site session details

Community site session details

Session Id : lj+iKR7KfbQKSy73H9Xbx4
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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,668 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard
Loading started