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 / Filter a Gallery Based...
Power Apps
Unanswered

Filter a Gallery Based On Text String AND Start and End Date And Sort In Descending Order

(0) ShareShare
ReportReport
Posted on by 16

Hello,

I am trying to implement a filter on a gallery in a Power App. Specifically, I have a text box that a user would need to enter a string value into and the filter should reduce the records displayed in the gallery to only those that feature a match to the string value entered on a field named “Entry”. Next, I am trying to implement an additional filter where a user can set a start date and end date and also have the gallery filter to display only those records where a table column named “ActivityDateTime” is between the selected start and end date. Lastly, the gallery should always be sorted to display records in descending order (most recent first) based on the “ActivityDateTime” field.

I’ve reviewed several posts in this forum but can seem to find out how to incorporate all filters in one piece of code in the gallery item property.

I have the filter based on the string input in the text field and the sort working but can’t figure out how to add in the date range.

 

Thank you

 

SortByColumns(

    Search(

        Daily_Activities,

        FilterEntry_TextBox.Value,

        "cr491_entry"

    ),

    "cr491_activitydatetime",

    SortOrder.Descending

)

Categories:
I have the same question (0)
  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @Tacobellz2020,

     

    The code below includes all filters. Since you are using Dataverse, you can search Text columns via the in operator without running into delegation issues:

    //You may have to double check the spelling of the referenced columns
    SortByColumns(
     Filter(
     Daily_Activities,
     //If you only want exact matches switch 'in' to =
     FilterEntry_TextBox.Value in entry,
     ActivityDateTime >= DatePickerStartDate.SelectedDate && ActivityDateTime <= DatePickerEndDate.SelectedDate
     ),
     "cr491_activitydatetime",
     SortOrder.Descending
    
    )

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 377 Most Valuable Professional

#2
11manish Profile Picture

11manish 165 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 110 Super User 2026 Season 2

Last 30 days Overall leaderboard