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 Galler...
Power Apps
Answered

Search and sort Gallery by date

(0) ShareShare
ReportReport
Posted on by 155

Hi,

 

I have a pre generated gallery that is arranged using the following:

 

Search([@'DRX Evolution Faults List'], SearchInput1_8.Text, "field_2", "field_2")

 

What would i need to add to this to ensure that it is also by default sorting in date order?

 

Any help would be greatly appreciated.

Categories:
  • KaiE Profile Picture
    39 on at

    Hi

     

    Try the following: 

    Sort(Search([@'DRX Evolution Faults List'], SearchInput1_8.Text, "field_2", "field_2"); DATE_FIELD; SortOrder.Descending)
  • TBODEN Profile Picture
    155 on at

    I forgot to add the field is called date reported, does this look correct as it doesnt seem to work

     

    Sort(Search([@'DRX Evolution Faults List'], SearchInput1_8.Text, "field_2", "field_2"); date reported; SortOrder.Descending)

  • KaiE Profile Picture
    39 on at

    Almost, usually a field with a space in its name from a sharepoint list needs to be put into ''. 

     

    So this should work: 

     

     

    Sort(Search([@'DRX Evolution Faults List'], SearchInput1_8.Text, "field_2", "field_2"); 'date reported'; SortOrder.Descending)

     

     

     

    Or: 

     

     

    Sort(Search([@'DRX Evolution Faults List'], SearchInput1_8.Text, "field_2", "field_2"); "date reported"; SortOrder.Descending)

     

     

     

    Did the search function work already or no? 

  • TBODEN Profile Picture
    155 on at

    Hi,

     

    Yeah it was a pre done one when you create a gallery automatically from list, for some reason it really doesnt like dates though

  • KaiE Profile Picture
    39 on at

    Could you provide a screenshot of the error and code?

  • TBODEN Profile Picture
    155 on at

    TBODEN_0-1705413546997.png

    TBODEN_1-1705413631022.png

     

     

  • TBODEN Profile Picture
    155 on at

    TBODEN_2-1705413705258.png

    as soon as i revert the data comes back

     

  • KaiE Profile Picture
    39 on at

    Okay, I'll just provide you with the way I do this in my apps: 

     

    Sort(Filter('DRX Evolution Faults List'; SearchInput1_8.Text in Text('field_2')); 'date reported'; SortOrder.Descending)

     

    'field_2' has to be the field you want to search. It's also possible that 'field_2' needs to be field_2 (without the apostrophes)

     

    Hopefully this works

  • TBODEN Profile Picture
    155 on at

    no luck 😞 it doesnt help that its auto generated so im less confident about what its doing in the background

  • KaiE Profile Picture
    39 on at

    Do you have intellisense when typing in the formula box?

     

    I'll provide the basic formula needed with generic names so you can try to troubleshoot with your specific use case.

     

    //Sort -> This is actual sorting (for the date)
    //Filter -> This is searching using the searchinput
    
    Sort(Filter(SHAREPOINT_LIST; SEARCHINPUT.Text in Text(COLUMN_OF_SHAREPOINT_LIST_FOR_SEARCHING)); DATE_COLUMN_FROM_SHAREPOINT_LIST; SortOrder.Descending)

     

    I hope you find a solution.

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 258

#3
Mohsin Ali Profile Picture

Mohsin Ali 231

Last 30 days Overall leaderboard