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

Check if textbox is number

ID_Code = TextInput1.Text

 

If I enter a string such as "ABC" into TextInput1, the above code will tell me if he user input (ABC) exists in the database's ID_Code column. Is there a way to get this to work with numbers? For example, if I type 123 into TextInput1, the code should check that specific input to see if it exists in the database. I had a look into casting, but couldn't get anything to work.

2 ACCEPTED SOLUTIONS

Accepted Solutions
bean
Level 8

Re: Check if textbox is number

To cast the textbox value to a number simply use this

 

Number(TextInput1.Text)

Good luck

Sean

View solution in original post

PowerApps Staff CarlosFigueira
PowerApps Staff

Re: Check if textbox is number

As @bean suggested, if you need to compare the value of a text box to a numeric column in your data source, you should convert it to a number first - using the Value function. For example, you can have a gallery with this expression for its Items property:

Filter(MyDataSource, ID_Code = Value(TextInput1.Text))

View solution in original post

4 REPLIES 4
bean
Level 8

Re: Check if textbox is number

Does this help?

 

If(IsNumeric(TextInput1.Text), "Number", "Alphanumeric")

Sean

bean
Level 8

Re: Check if textbox is number

If you could provide more detail on what you're trying to do that will help more.

 

Cheers

bean
Level 8

Re: Check if textbox is number

To cast the textbox value to a number simply use this

 

Number(TextInput1.Text)

Good luck

Sean

View solution in original post

PowerApps Staff CarlosFigueira
PowerApps Staff

Re: Check if textbox is number

As @bean suggested, if you need to compare the value of a text box to a numeric column in your data source, you should convert it to a number first - using the Value function. For example, you can have a gallery with this expression for its Items property:

Filter(MyDataSource, ID_Code = Value(TextInput1.Text))

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate 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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 85 members 5,468 guests
Please welcome our newest community members: