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 / SortbyColumns and Sear...
Power Apps
Answered

SortbyColumns and Search problem

(0) ShareShare
ReportReport
Posted on by 20

I have sortbycolumns and search function for a table as Item with code below, however the sort order idoes not correct (not follow by ID) and info in the table is lacking also after put code, (Entity is Choice column, ID is default column in SPlist). Please help me to fix the code

 

 

Categories:
I have the same question (0)
  • CU22040918-0 Profile Picture
    195 on at

    Hi @rome_knight ,

     

    The code snippet syntax looks good. Could you please share some screenshots to illustrate the error?

     

    Nelson

     

  • rome_knight Profile Picture
    20 on at

    It should be arrange following latest event, however after the code, the order is wrong

     

     

  • Verified answer
    Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @rome_knight

    Try

    With({_items: Sort('Bypass TH Status',ID, Sort Order. Descending)}, 

    Search(

    AddColumns(_items, "EntityValue", Entity.Value),

    TextSearch.Text,

    "EntityValue"

    )

     

    And see if you get a different result. 

     

  • CU22040918-0 Profile Picture
    195 on at

    Hi @rome_knight ,

     

    That's weird! 

     

    I would take delegation issue into consideration!

     

    How many items does 'Bypass TH Status' have? Is it a sharepoint list?

     

    Kindly noted that Search() and AddColumns() are not delegable, so only first 500 items will be returned from data source by default. 

    Try to increase delegation data limit to 2000(max) if your table row count is less than 2000.

    NelsonYan_0-1679470206808.png

     

    Also you can try to use Filter function as below which is delegable, but the search text must be exactly same. For that case, a dropdown or combobox would be better.

     

    SortByColumns(
     Filter(
     'Bypass TH Status',
     Entity.Value=textSearch.Text
     ),
    "ID",SortOrder.Descending) 

     

    Nelson

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 296 Most Valuable Professional

#2
11manish Profile Picture

11manish 224

#3
Valantis Profile Picture

Valantis 181

Last 30 days Overall leaderboard