cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PAM-thrive
Level: Powered On

Dealing with % in input

Hello's,

I have an app with an input field restricted to just numbers. However I also want to stop users from putting in a % symbol as it just converts their value which is not desired once the form is submitted.

 

Is there a way to stop this input being allowed, or the best method to remove it before the form submits please?

 

thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Dealing with % in input

Whats the Update property of this control?

Is it DataCardValue7.Text?

Then replace it with the formula I suggested:

Substitute(DataCardValue7.Text, "%", "")

Let me know if this helps.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
https://thepoweraddict.com

View solution in original post

10 REPLIES 10
Super User
Super User

Re: Dealing with % in input

One of the ways to handle this is to use the Substitute function. If your field is in a TextInput field for example, you could do something like this:

Substitute(TextInput1.Text, "%", "")

Let me know if this helps.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
https://thepoweraddict.com
PAM-thrive
Level: Powered On

Re: Dealing with % in input

Thanks @PowerAddict, but this doesn't appear to work.

 

I've tried adding Substitute(DataCardValue7.Text, "%", "") to the OnChange property of the input box, which didn't work so I also tried having it on OnSelect property of the submit button such as Substitute(DataCardValue7.Text, "%", "");SubmitForm(form1) but this also still didn't work.

 

Possibly I'm doing this in the wrong place?

The input box format property is set to Number, not text

Super User
Super User

Re: Dealing with % in input

Is this TextInput control within a form? Also, what are you using to submit this value to the data source? Is it SubmitForm or Patch?

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
https://thepoweraddict.com
PAM-thrive
Level: Powered On

Re: Dealing with % in input

Yep, the TextInput is inside a form. The Textbox is set to numbers only (but it still allows %) 

This submits to a sharepoint list using SubmitForm. (never used patch before)

Problem being is multiple users use this some record a % some record actual value. I am looking to only submit a number/value and I'll deal with % further down the line.

Capture.PNG

Super User
Super User

Re: Dealing with % in input

Whats the Update property of this control?

Is it DataCardValue7.Text?

Then replace it with the formula I suggested:

Substitute(DataCardValue7.Text, "%", "")

Let me know if this helps.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
https://thepoweraddict.com

View solution in original post

PAM-thrive
Level: Powered On

Re: Dealing with % in input

Perfect @PowerAddict thank you so much for your help. I would never have thought to look at that Update property! 

Super User
Super User

Re: Dealing with % in input

Glad I could help! Good luck with the rest of your app! Feel free to reach out in case of any questions!

Thanks,
Hardit Bhatia
The Power Addict
https://thepoweraddict.com
Super User
Super User

Re: Dealing with % in input

@PAM-thrive 

I know this thread is already solved but would changing the Format property of the Text Input to Number be a valid solution here too?  This would ensure no letters or symbols would be allowed. 

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

PAM-thrive
Level: Powered On

Re: Dealing with % in input

@mdevaney unfortunately that doesn't help.

The format is already set to Number, and this format does appear to support % symbol.

 

 

Interesting I tried to apply the same fix above, to another app that does similar things, but there is no "Update" property. From what I read this is somehow related to the tables unique identifier. 

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

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