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

Search only returning string values, need integer

Search(Table1,TextSearchBox1.text, "ID")

 

I am using the above code for most of my app and it works fine when the column is based on strings and not numbers. I have one column that is counting something, so it is a number. I can't find how to call this for the search function. Do I need to put in TextSearchBox1.Value?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Power Apps
Power Apps

Re: Search only returning string values, need integer

The Search function only works for text-based columns. If I try to use it in my database for a numeric column, I get the following error (and hover on the "Id" column name):

ForumPost001.PNG

You can use the Filter function to accomplish a similar thing:

Filter('[blog20170901].[Accounts]', TextInput1.Text in Text(Id))

Which may not be exactly what you want for a numeric column - this will filter the data source for values which contain the given text. For example, if TextInput1.Text is "2" (without quotes), it will return rows where the Id is 2, 123, 432, and so on. You can also use the comparison operators (=, <>, <, >, <=, >=) to make numeric comparisons, such as

Filter('[blog20170901].[Accounts]', Value(TextInput1.Text) > Id)

Which will return all rows where the id is value of the text input is larger than the id.

View solution in original post

2 REPLIES 2
Highlighted
Continued Contributor
Continued Contributor

Re: Search only returning string values, need integer

Try

 

Search(Table1,Value(TextSearchBox1.text), "ID")

 

or

 

Search(Table1,Number(TextSearchBox1.text), "ID")?

 

Sean

Highlighted
Power Apps
Power Apps

Re: Search only returning string values, need integer

The Search function only works for text-based columns. If I try to use it in my database for a numeric column, I get the following error (and hover on the "Id" column name):

ForumPost001.PNG

You can use the Filter function to accomplish a similar thing:

Filter('[blog20170901].[Accounts]', TextInput1.Text in Text(Id))

Which may not be exactly what you want for a numeric column - this will filter the data source for values which contain the given text. For example, if TextInput1.Text is "2" (without quotes), it will return rows where the Id is 2, 123, 432, and so on. You can also use the comparison operators (=, <>, <, >, <=, >=) to make numeric comparisons, such as

Filter('[blog20170901].[Accounts]', Value(TextInput1.Text) > Id)

Which will return all rows where the id is value of the text input is larger than the id.

View solution in original post

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

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

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (9,377)