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 / Search and Sort errors...
Power Apps
Answered

Search and Sort errors for gallery

(0) ShareShare
ReportReport
Posted on by 89

My SharePoint List creates the ID for every new entry (numerical only).  We have a field, Item ID, that appends WR or RE or PI to the front of that number based on the type of request being submitted.

 

I want my PowerApps List to Sort by ID (numerical) in Descending Order but display the Item ID.  When I use the below on the gallery, it sorts as intended, with no problems.

                SortByColumns('Work Requests',"ID",SortOrder.Descending)

 

Sort Results

pandalove19_0-1715961990188.png

 

The issues start when I’m trying to add Search to the gallery.  I need to be able to search the list using multiple fields but it’s not pulling results.  Also, the sorting isn’t correct. 

 

SortByColumns(

    Search(

        'Work Requests',

        Input_SearchBox_1.Text,

        'Title',

        'CR Number',

        'Item ID',

        'Change(s) to Current Process',

        'Updates Required',

        'Current Process'

    ),

    "ID",

    SortOrder.Descending

)

 

Sort Results

pandalove19_1-1715961990191.png

 

Search Results

pandalove19_2-1715962084208.png

 

Categories:
  • Verified answer
    elseb Profile Picture
    774 Moderator on at

    Hi,

     

    Try this:

    SortByColumns(Filter('Work Requests', StartsWith(Title,Input_SearchBox_1.Text) || StartsWith('CR Number',Input_SearchBox_1.Text) || StartsWith('Item ID',Input_SearchBox_1.Text)), "ID", SortOrder.Descending)

     

     

  • pandalove19 Profile Picture
    89 on at

    That worked for the Descending Sort and the "starts with" search for the CR Number, WR ID, and WR Owner.  I do need to search for keywords contained in other fields (doesn't necessary start with that word). 

     

    Suggestions on how to incorporate that into the formula?  Fields:   'Title',  'Change(s) to Current Process', 'Updates Required', 'Current Process'

  • pandalove19 Profile Picture
    89 on at

    That worked for the Descending Sort and the "starts with" search for the CR Number, WR ID, and WR Owner.  I do need to search for keywords contained in other fields (doesn't necessarily start with that word). 

     

    Suggestions on how to incorporate that into the formula?  Fields:   'Title',  'Change(s) to Current Process', 'Updates Required', 'Current Process'.  I've tried to use Search and Filter in the same formula and I'm not getting results.

  • elseb Profile Picture
    774 Moderator on at

    You can use "In" to search for the string within another, problem is depending on the use you may run into delegation issue.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 239

Last 30 days Overall leaderboard