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 / Data Validation only d...
Power Apps
Answered

Data Validation only digit without character

(0) ShareShare
ReportReport
Posted on by

HI

 

I want a validation to have only digit (1-9) and not other characters like +&% etc.

 

I have created many ways but it is accepting the characters. I have added other validation to this datacard and they are working correctly. Only this part not working

 

!IsMatch(Card.Text,"[1-9]") 

!IsMatch(Card.Text,"/d")

 

 

Pls help

Categories:
I have the same question (0)
  • Verified answer
    Mitanshu Profile Picture
    1,650 Moderator on at

    Have you tried:
    IsMatch(TextInput1.Text,"\d+")

     

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up

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

    @indhaa 

    If you only want one digit, then:

       !IsMatch(Card.Text,"/d{1}")

     

    I hope this is helpful for you.

  • indhaa Profile Picture
    on at

    If it allows between 6 digits? Can be between 1 - 6 digit  

  • indhaa Profile Picture
    on at

    Yah tried.

    But that allows characters

  • indhaa Profile Picture
    on at

    Hi

     

    I tried like this but it still allows

     

    !IsMatch(Card.Text,"\d{1,6}")

  • indhaa Profile Picture
    on at

    So it seem due to joined condition it was not working. Splitting the code seem to resolved it

     

    No issue with code

  • indhaa Profile Picture
    on at

    This one was the first I tried.

     

    So it seem due to joined condition it was not working. Splitting the code seem to resolved it

     

     

  • indhaa Profile Picture
    on at

    Is there a way I can restrict starting with zero. That it cant contain ONLY zero.. there should be another digit

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

    @indhaa 

    I understood your post to say that you only wanted ONE digit.  As I re-read it, you were more or less saying that you wanted ONLY digits.

     

    You can also drop the regular expressions and use formulas like this:

    IsNumeric(Card.Text) && Len(Card.Text)=6

    This will return true if the Card.Text is all numeric digits and it is 6 digits long.

     

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!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 70

#2
WarrenBelz Profile Picture

WarrenBelz 64 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 36 Super User 2026 Season 1

Last 30 days Overall leaderboard