cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Filter gallery using datepicker

I can't seem to figure out how to add a datepicker and be able to filter my gallery by the selected date. 

I have a sharepoint list, where all my information is stored and have a column called "date".

I have the following formula in Items (from my gallery):

Filter ("my sharepoint list name", Date=DatePicker1.SelectedDate)

 

But for some reason it's not working. 

Please let me know what I'm doing wrong.

 

Thanks, 

Janette 

 

 

 

18 REPLIES 18

Try just using the following.  Since you are doing a range I don't think you will have the problem that this thread was about.

Filter('Perimeter Issues', Building = Dropdown1.Selected.Result, Date >= DatePicker1.SelectedDate && Date <= DatePicker2.SelectedDate)

This is of course assuming that your Datetime column is called Date.  I would normally suggest a name for the column that isn't a reserved word.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Sorry, the comma in there was a typo

Filter('Perimeter Issues', Building = Dropdown1.Selected.Result && Date >= DatePicker1.SelectedDate && Date <= DatePicker2.SelectedDate)


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Hi,

 

That didn't to bring up any results.

 

My column name is Date and has been set to Date and Time.

I've been doing some addtional searching and have come up with this solution.  Bit more formula involved but it does seem to work, not sure how but does???

Filter('Perimeter Issues',DateValue(Text(Date),"en-GB")>=DateValue(Text(DatePicker1.SelectedDate),"en-GB") && DateValue(Text(Date),"en-GB")<= DateValue(Text(DatePicker2.SelectedDate),"en-GB"))

 

Just working on to put it Decending order now

 

Thanks for your assitance 

As I said, in your case you really don't need the DateValue(Text()) functions.  If you can get it to work that way fine.  But it isn't necessary. There is something else going on if it doesn't throw an error, but doesn't bring up any records.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Hi,

 

I agree it does seem to be a bit lomg winded for what should be a simple solution.

 

Have you any ideas what could be the stumbling block?

try removing the building = dropdown from the Filter and see if you can get the date ranges working.  Then you can see about adding it back in.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

 

Filter('Perimeter Issues', Date >= DatePicker1.SelectedDate && Date <= DatePicker2.SelectedDate)

 

No still no luck retrieving data

I'm not sure what to tell you.  That exact syntax works for me. As I said, I would use a different column name than 'Date'.  Other than that I'm not sure what to suggest.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Hi,

I know SP sometimes acts funny if elements have been changed.

What I will try is create a new SP list and label the columns different and see if that works

Thanks for all you assistanceSmiley Happy

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (2,931)