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 / Can't block small lett...
Power Apps
Answered

Can't block small letter alphabets in Power Apps

(0) ShareShare
ReportReport
Posted on by 393

Dear Experts,

 

How to formulate power apps to block both Capital Letter and Small Letter Alphabet?

 

My formula is:

IsMatch(DataCardValue1.Text,".*[\\\"&Char(34)&"/<>!@#$%^&.'*(),=-_|{}~:;+-].*")

 

The app behaves to my expectation to block Capital Letter:

JAWL_0-1639555231099.png

However, the app cannot block small letters:

JAWL_1-1639555362878.png

 

 

 

Categories:
  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    Check out this Video by @RezaDorrani 

    https://www.youtube.com/watch?v=XvevCq6qhX4&t=1268s

    Start watching from 5:44

  • JAWL Profile Picture
    393 on at

    @zmansuri That is super useful! By the way, how can I modify the formula to allow hyphen "-" only and block all other special characters?

     

    Coalesce(
    Parent.Error,
    If(
    !IsBlank(DataCardValue6.Text) &&
    !IsMatch(
    DataCardValue6.Text,
    Match.MultipleDigits
    ),
    "Only number is allowed"
    )
    )

     

    JAWL_0-1639558926702.png

     

  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    If(
    !IsBlank(TextInput1.Text) && !IsMatch(
    TextInput1.Text,
    "\d\d\d-\d\d"
    ),
    "Only number is allowed"
    )

  • JAWL Profile Picture
    393 on at

    Hi @zmansuri , I guess "\d\d\d-\d\d" is only limited to that format right?

    What I want is to allow ANY free format (\d\d\d\d; \d\d\d\-\d\d; \d\d\d\-\d\d\-\d\d, etc.) as long as they are numbers and/or hyphens, how can we further modify the formula?

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

    Hi @JAWL :

    Regular expressions that only allow numbers and ‘-’ can use 

    "[0-9-]*"

    For example:

    vbofengmsft_0-1639634736846.png

    Best Regards,

    Bof

     

  • JAWL Profile Picture
    393 on at

    @v-bofeng-msft Amazingly works as expected! Thanks for your help!

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 393 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 278 Most Valuable Professional

Last 30 days Overall leaderboard