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 i can make sure th...
Power Apps
Unanswered

How i can make sure that the user did not enter any special characters (except ",") inside a text field.

(0) ShareShare
ReportReport
Posted on by 1,950 Season of Giving Solutions 2025

I have a text field where users can enter characters and numbers and only this special characters "," -comma-. so how i can force this rule inside my field?

thanks

Categories:
I have the same question (0)
  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @johnjohnPter see this useful article:

    https://www.practicalpowerapps.com/data/specialcharacters/ 

  • v-mengmli-msft Profile Picture
    Microsoft Employee on at

    Hi @johnjohnPter ,

     

    Please try this:

    1)Create a collection of ASCII values for special characters except comma.

    OnVisible of screen:
    ClearCollect(
     col,
     ForAll(
     Sequence(15),
     {test: Char(32 + Value)}
     ),
     ForAll(
     Sequence(7),
     {test: Char(57 + Value)}
     ),
     ForAll(
     Sequence(5),
     {test: Char(90 + Value)}
     ),
     ForAll(
     Sequence(4),
     {test: Char(122 + Value)}
     )
    );
    RemoveIf(col,test=Char(44))

    2)Set the textinput:

    OnChange:ForAll(col,If(test in Self.Text,Notify("can not enter any special characters except(,)")&Reset(Self)))

     

     

    Best regards,

    Rimmon

  • johnjohnPter Profile Picture
    1,950 Season of Giving Solutions 2025 on at

    @v-mengmli-msft Thanks for the reply ,,,so power apps does not provide this list of special chars out of the box?

  • v-mengmli-msft Profile Picture
    Microsoft Employee on at

    As far as I know, it doesn't have.

  • johnjohnPter Profile Picture
    1,950 Season of Giving Solutions 2025 on at

    @v-mengmli-msft it worked for me thanks.. but how i can only allow numbers and "," .. without characters is this possible?

  • v-mengmli-msft Profile Picture
    Microsoft Employee on at

    Hi @johnjohnPter ,

     

    Just numbers and ","?

    It seems that I missed something....

    Please modify above code:

    OnVisible of screen:
    ClearCollect(
     col,
     ForAll(
     Sequence(9),
     {test: Char(48 + Value)}
     ),
     {test: Char(44)}
     
    )
    OnChange of TextInput:
    ForAll(Split(Self.Text,"") As C,If(Not(C.Value in col),Notify("can not enter any special characters")&Reset(Self)))

     

    Best regards,

    Rimmon

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!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 610

#2
Haque Profile Picture

Haque 317

#3
WarrenBelz Profile Picture

WarrenBelz 315 Most Valuable Professional

Last 30 days Overall leaderboard