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 / How to force user to e...
Power Apps
Answered

How to force user to enter the digits at the end of a string only

(0) ShareShare
ReportReport
Posted on by 8

Hi All,

 

I have a requirement where i need to force user to enter the digits(if required) at the end of the string only. 

e.g. 

Test - Allowed

Test12 - Allowed

Test.Test - Allowed

Test.Test12 - Allowed

Test12.Test - Not Allowed

Test.12Test - Not Allowed

12Test - Not Allowed

Te12st - Not Allowed

 

Is there a way i can achieve this validation?

 

Thanks

 

Categories:
I have the same question (0)
  • MVP-Phipps Profile Picture
    3,514 Super User 2024 Season 1 on at

    The only way I can think of doing this is by using the Match or IsMatch function within an if statement. Please refer to this documentation: https://docs.microsoft.com/en-us/power-apps/maker/canvas-apps/functions/function-ismatch 

     

    Please Accept as Solution if it solves your question. Or just give it a Thumbs Up if it is helpful as can help others.

     

    LinkedIn: https://www.linkedin.com/in/charlie-phipps-%F0%9F%91%A8%E2%80%8D%F0%9F%92%BB-91338715b/ 

    Subscribe to my YouTube: https://www.youtube.com/channel/UChmFBGU1YKIU91sNMQ7buGg

  • Verified answer
    Ashwin7104 Profile Picture
    671 on at

    Hey @garga ,

     

    The below code is not the prettiest one but it works ! Please replace TextInput5 with your control

     

    If(
     !IsNumeric(TextInput5.Text),
     If(
     IsNumeric(
     Right(
     TextInput5.Text,
     1
     )
     ),
     "ok",
     IsMatch(
     TextInput5.Text,
     "[a-zA-Z._^%$#!~@,-]+"
     ),
     "ok",
     "Not ok"
     )
    )



    If this post helped you, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

      

  • MVP-Phipps Profile Picture
    3,514 Super User 2024 Season 1 on at

    @Ashwin7104 IsMatch function with Regex, I was spot on then 👊

     

    @garga you then use Notify function for OK or not ok 

  • garga Profile Picture
    8 on at

    It worked for some cases but failed when i entered this text:

     

    Te12st34

  • garga Profile Picture
    8 on at

    Thanks for the reply. I had to create regex for my specific case and i got it working. 

    IsMatch(TextInput1.Text,"([a-z]+)+(\d+)?$")

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
WarrenBelz Profile Picture

WarrenBelz 549 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 225 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 224

Last 30 days Overall leaderboard