web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter with Search tog...
Power Apps
Answered

Filter with Search together

(0) ShareShare
ReportReport
Posted on by

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!

 

Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,989 Moderator on at

    @Anonymous 

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

  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @Anonymous 

     

    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.

  • Community Power Platform Member Profile Picture
    on at

    Thank you so much! But why value?

  • mdevaney Profile Picture
    29,989 Moderator on at

    @Anonymous 

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

  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @Anonymous

     

    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

     

     

  • Verified answer
    v-xida-msft Profile Picture
    on at

    Hi @Anonymous ,

    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,

  • Robot_Dølhus Profile Picture
    9 on at

    Thank god i found your reply. I finally made it work with this command. Didnt know i had to filter inside my search function.

    Search(Filter(VikarLog;OrdereEmail=varCurrentUser.Email); AktiveringsHistorikSearch.Text; "VikarName")

  • Vero55 Profile Picture
    8 on at

    Hi all, I am trying to put a dropdown on of the gallery. However, there's already a filter function on it. How can I put all these functions together?


    My Current function (working) is:
    SortByColumns(Filter([@'Inside Trading List'], StartsWith(Title, TextSearchBox1.Text)), "Title", If(SortDescending1, SortOrder.Descending, SortOrder.Ascending))
    -Where it is filtering in a Searchtext Box, whatever text is needed from my title column list.

     

    But I also need to put a dropdown for them to be able to filter by category, which is a "text" column list in SharePoint.

     

    I know that the other function for my drop down, for which items are Distinct ('Inside Trading List', Category) 
    So I know that I can filter by using the drop down with this formula, as I tested it and it works:
    Filter([@'Inside Trading List'], Category = Dropdown1.Selected.Result)

    How can I put all these functions together?

    SortByColumns(Filter([@'Inside Trading List'], StartsWith(Title, TextSearchBox1.Text)), "Title", If(SortDescending1, SortOrder.Descending, SortOrder.Ascending)) &

    Filter([@'Inside Trading List'], Category = Dropdown1.Selected.Result)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard