cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
LuisGuzman98
Level: Powered On

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
Eelman
Level 10

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
Eelman
Level 10

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
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (4,809)