cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DaleM299
Frequent Visitor

Datepicker to filter Gallery

Hello, I have looked at the other posts regarding this same issue however I'm not able to use the solutions to resolve my issue. I am very new to Powerapps.

 

I have created a list in Sharepoint, and I used it to create a Powerapp. I have the gallery sorting my list correctly, however, I would like to add a Datepicker to filter only the list items that meet the selected date. I have a column in the Sharepoint list with a date.

 

I have read about Powerapps getting invalid results because of the shortdate issue and Sharepoint has the time with the date. I have seen several workarounds like setting the selected date specifically such as

"Filter('Right Start Attendees','RSO Date'<=Date(Year(DatePicker.SelectedDate),Month(DatePicker.SelectedDate),Day(DatePicker.SelectedDate)),'RSO Date'>=Date(Year(DatePicker.SelectedDate),Month(DatePicker.SelectedDate),Day(DatePicker.SelectedDate)))

 

And this one

(https://powerusers.microsoft.com/t5/Building-Power-Apps/Filter-gallery-using-datepicker/m-p/308046#M...)

Filter('SharePoint List Name',Text(Date,ShortDate) =  Text(DatePicker1.SelectedDate,ShortDate))

However, I'm not doing something correctly.

 

Currently, my Gallery Items object looks like this:

Sort('Right Start Attendees', Title,Ascending)

 

I'm not sure how to filter on the column in my SharePoint list name 'RSO Start Date' with the datepicker,  I'm not sure what all other information I could include that would be helpful to include here.

 

Thanks in advance!

Dale

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
PG_WorXz10
Community Champion
Community Champion

Hi @DaleM299 ,

 

Could you please try below code ? 

 

SortByColumns( Filter('Right Start Attendees',Text('RSO Start Date',"dd/mm/yyyy") = Text(DatePicker.SelectedDate,"dd/mm/yyyy")),"Title",Ascending)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

View solution in original post

4 REPLIES 4
PG_WorXz10
Community Champion
Community Champion

Hi @DaleM299 ,

 

If not tried before could you try the below code ? 

Let me know the outcome. 

Sort( Filter('Right Start Attendees','RSO Start Date' = DatePicker.SelectedDate),Title,Ascending)

 

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

Hello PG_Worxz10,  thank you so much for helping! Unfortunately, that line did not produce the desired effect.

I will attach screen captures of the before and after results, however, the result was that the title was missing from the Gallery, and the date was not recognized. 

 

DaleM299_0-1631193120540.png

DaleM299_1-1631193156419.png

 

 

PG_WorXz10
Community Champion
Community Champion

Hi @DaleM299 ,

 

Could you please try below code ? 

 

SortByColumns( Filter('Right Start Attendees',Text('RSO Start Date',"dd/mm/yyyy") = Text(DatePicker.SelectedDate,"dd/mm/yyyy")),"Title",Ascending)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

Hello PG_WorXz10,

Thank you for your patience on my reply.  That worked! thank you so much! I'm studying the line to learn the syntax for future projects.

 

The only issue with it, there is a delegation warning on the Filter. I have read about this issue with Sharepoint lists and excel sheets, I suppose that is a different issue to tackle.  Again, thank you so much for taking the time to help me, I will mark this as the accepted solution. You Rock!

DaleM299_0-1631204193110.png

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (1,687)