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 or Sort won't work
Power Apps
Answered

Filter or Sort won't work

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I use a 4 column Sharepoint list h0_1, in which a user can input data. Patch operation (1st  screen) works fine, however sort function won't work. This is a very small list (<<500).

 

 

 

ClearCollect(Aent, {Date:DatePicker2.SelectedDate,Title:TextInput1.Text, Ar:Value(1),Dep:Value(1)});TextInput1.Text=Text("Date");
Patch(h0_1,Defaults(h0_1),Last(Aent));
SortByColumns(h0_1,"Date")

 

In Screen2 I  use a Gallery. I want to filter its data by seleced date from DatePicker1.

 

Filter(h0_1, Text(Label1.Text)=Text(DatePicker1.SelectedDate,"[$-en-US]dd-mm-yyyy" ))

 

This does not work.f1.pngf0.png

 

Categories:
I have the same question (0)
  • Verified answer
    CarlosFigueira Profile Picture
    Microsoft Employee on at

    The Filter and SortByColumns functions do not change the collection/list to which they are applied. Instead, they return a new table that is filtered / sorted based on the arguments instead.

     

    You should update the Items property of your gallery to use the Filter / Sort functions there. For example, in the Gallery1, on Screen2, you can have this expression for the Items property:

    Filter(h0_1, Label1.Text = Text(DatePicker1.SelectedDate,"[$-en-US]dd-mm-yyyy" ))

    Likewise for the sort operation - you use that function in the place where you want the data sorted.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

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

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 316 Most Valuable Professional

#2
11manish Profile Picture

11manish 242

#3
Valantis Profile Picture

Valantis 198

Last 30 days Overall leaderboard