cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Replace a character when it is entered into a Text Field

Hello, 

 

I have a form I need users to fill out. 

 

There's a text input from the form where I would like to block every "-" character that it is entered in it. 

 

For example if someone enters "HMI-895" I want that the text input field from the form to convert that into "HMI895".

 

Is there any way to do that?

 

Thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Replace a character when it is entered into a Text Field

@LuisGuzman98 

If this is all you are looking to replace then the Substitute() function could be all you need, like:

 

Substitute( TextInput1, "-", "" )

 

You would put this code in the Update property of your datacard. Here's a link to the docs regarding Substitute:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-replace-substitute

 

View solution in original post

1 REPLY 1
Highlighted
Super User
Super User

Re: Replace a character when it is entered into a Text Field

@LuisGuzman98 

If this is all you are looking to replace then the Substitute() function could be all you need, like:

 

Substitute( TextInput1, "-", "" )

 

You would put this code in the Update property of your datacard. Here's a link to the docs regarding Substitute:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-replace-substitute

 

View solution in original post

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,362)