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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Using Search, Filter a...
Power Apps
Answered

Using Search, Filter and SortByColumns

(0) ShareShare
ReportReport
Posted on by 25

I admit defeat! I've spent about 7 hours (no exaggeration) trying to solve this myself by using various sources online and I just can't.

 

I'm creating a computer asset management "system" in Power Apps and all the asset data is held in a SharePoint list with various column formatting. 

 

I've got my gallery setup but I'm now trying to create a search bar. I want to use all 3 of the formulas below:

 

SortByColumns(Assets_Computer,"Computer_x0020_Name")

Search(Assets_Computer,SearchBox.Text,"Computer_x0020_Name","Title","ServiceTag")

Filter( Assets_Computer, StartsWith(Model.Value,SearchBox.Text)||StartsWith('Assigned to'.DisplayName,SearchBox.Text))

 

By process of elimination I know all of these formulas work individually but I'm unable to get them all to work together, I have tried every conceivable combination so I'm obviously missing something (I'm still relatively new to Power Apps)

 

I'm not sure if I'm using the correct functions for each and think other issue's will arise but I will try to provide as much info as I can:

 

Computer_x0020_Name, Title and ServiceTag are single line text I believe.

Model is being pulled in to Assets_Computer from another SharePoint List (I didn't set this up so not sure why)

Assigned to is a person column.

 

I'm not sure if it should be filtered or searched first as the model is going to have a lot more of the same entries where as title and service tag are all going to be unique along with persons for the most part.

 

Thanks in advance and hopefully I make sense.

 

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    155,983 Most Valuable Professional on at

    Hi @XDUKERMANX ,

    Have you tried this?

    SortByColumns(
     Search(
     Filter(
     Assets_Computer,
     StartsWith(
     Model.Value,
     SearchBox.Text
     )||
     StartsWith(
     'Assigned to'.DisplayName,
     SearchBox.Text
     )
     ),
     SearchBox.Text,
     "Computer_x0020_Name",
     "Title",
     "ServiceTag" 
     ),
     "Computer_x0020_Name"
    )

    This should also work

    SortByColumns(
     Filter(
     Assets_Computer,
     StartsWith(
     Model.Value,
     SearchBox.Text
     )||
     StartsWith(
     'Assigned to'.DisplayName,
     SearchBox.Text
     ) ||
     SearchBox.Text in 'Computer Name' ||
     SearchBox.Text in Title ||
     SearchBox.Text in ServiceTag
     ),
     "Computer_x0020_Name"
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • XDUKERMANX Profile Picture
    25 on at

    Neither seem to be working.

     

    It is returning results when searching for 'Assigned to' and 'Model but 'Computer Name', 'Title' and 'ServiceTag' don't appear to be returning any results.

  • WarrenBelz Profile Picture
    155,983 Most Valuable Professional on at

    @XDUKERMANX ,

    Not sure why the first one does not work - the syntax is correct - corrected second one (dangers of free-typing).

    If it does not work now on the second one, you need to look at your data.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

  • XDUKERMANX Profile Picture
    25 on at

    The second one works. It now returns results from searching from all fields.

     

    Thanks dude.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 320 Most Valuable Professional

#2
11manish Profile Picture

11manish 210

#3
Valantis Profile Picture

Valantis 167

Last 30 days Overall leaderboard