cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Regular Visitor

Filter with Search together

Hi, 

 

I am trying to put search in on of the gallery. However, there's already a filter function on it. How can I put both the functions together. 

 

My Current function is: Filter('sqlservetable' , XYZ=123) 

 

But I also need to put search so that users can find specific numbers while app is retrieving certain fields through a table. 

 

I tried to put:

 

Search(Filter('sqlservertable' , XYZ=123), searchbox_1.Text, XYZ)

 

But it is not working. It would be helpful if you could please let me know how does that work. I am new to PowerApp. Any help is  much appreciated!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @Gaurav01 ,

Could you please share a bit more about the "XYZ" column in your data source? Is it a Number type column?

 

Based on the formula you provided, I think there is something wrong with it. In addition, I think the Value(searchbox_1.Text) could not also fix your issue.

The second argument of the Search function is required to provide a Text value rather than a number value. The third argument of the Search function is required to provided a Text type column (should be wrapped with double quotes "" ).

 

As an alternative solution, I think the AddColumns function could achieve your needs. Please consider modify your formula as below:

Search(
       AddColumns(Filter('sqlservertable' , XYZ=123), "TextXYZ", Text(XYZ)),
       searchbox_1.Text, 
       "TextXYZ"
)

Note: Please consider set the "Data row limit for Non-delegable queries" option to maximum value -- 2000 within Advanced settings of App settings of your app.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
Super User III
Super User III

@Gaurav01 

Your code looks fine except one minor detail.  You will need to convert your Searchbox text into a Value so it matches the data type of the number you are looking for.  I had a similar issue when I was beginning PowerApps.

 

Search(Filter('sqlservertable' , XYZ=123), Value(searchbox_1.Text), XYZ)

 

---
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."

Super User II
Super User II

@Gaurav01 

 

Presuming your data type is supposed to be a number, you should use something like Value(searchbox_1.Text)

 

This could be one possible reason why it was not working.

Thank you so much! But why value?

@Gaurav01 

Value converts a Text string into a number data type.  You must compare a number data type to another number data type.

 

---
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."

@Gaurav01

 

Because that PowerApps function converts Text to an actual Number value, which is what your app might be expecting in this case because the data type is Number, but the entered search box text is of type Text which needs to be converted to Number.

 

 

"The Value function converts a string of text that contains number characters to a number value. Use this function when you need to perform calculations on numbers that were entered as text by a user."

 

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

 

 

Community Support
Community Support

Hi @Gaurav01 ,

Could you please share a bit more about the "XYZ" column in your data source? Is it a Number type column?

 

Based on the formula you provided, I think there is something wrong with it. In addition, I think the Value(searchbox_1.Text) could not also fix your issue.

The second argument of the Search function is required to provide a Text value rather than a number value. The third argument of the Search function is required to provided a Text type column (should be wrapped with double quotes "" ).

 

As an alternative solution, I think the AddColumns function could achieve your needs. Please consider modify your formula as below:

Search(
       AddColumns(Filter('sqlservertable' , XYZ=123), "TextXYZ", Text(XYZ)),
       searchbox_1.Text, 
       "TextXYZ"
)

Note: Please consider set the "Data row limit for Non-delegable queries" option to maximum value -- 2000 within Advanced settings of App settings of your app.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (3,853)