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

Filter a Gallery by tow DatePickers

Hello guys,

 

I need a help, I have a gallery with all this data shown in tables. However, I need to filter this data between two dates (DatePicker1 and DatePicker2) in this gallery.

 

I can filter the gallery in just one DatePicker, but I can not use the 2 to range.

 

Could someone help me in the code?

 

Follow the image to demonstrate how the application layout is.

 

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @Anonymous ,

Do you want to filter a data table according to two date pickers?

I made a similar test as follows:

Create a data table(shows two items:student,modified on),two date pickers named date picker1 and date picker2

Set the data tale’s items:

Filter(
             students,
            DateValue(Text(modifiedon,"[$-en- US]mm/dd/yyyy"))
                   >=DateValue(Text(DatePicker1.SelectedDate,"[$-en-US]mm/dd/yyyy"))
            &&DateTimeValue(Text(modifiedon,"[$-en-US]mm/dd/yyyy")) 
                   <=DateValue(Text(DatePicker2.SelectedDate,"[$-en-US]mm/dd/yyyy"))
                                                         )

test1_329.jpg

 

After these practices,the items that the data table shows will be filter according to two date piackers.

 

 

 

Best regards,

Community Support Team _ Phoebe Liu

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Community Support
Community Support

Hi @Anonymous ,

Do you want to filter a data table according to two date pickers?

I made a similar test as follows:

Create a data table(shows two items:student,modified on),two date pickers named date picker1 and date picker2

Set the data tale’s items:

Filter(
             students,
            DateValue(Text(modifiedon,"[$-en- US]mm/dd/yyyy"))
                   >=DateValue(Text(DatePicker1.SelectedDate,"[$-en-US]mm/dd/yyyy"))
            &&DateTimeValue(Text(modifiedon,"[$-en-US]mm/dd/yyyy")) 
                   <=DateValue(Text(DatePicker2.SelectedDate,"[$-en-US]mm/dd/yyyy"))
                                                         )

test1_329.jpg

 

After these practices,the items that the data table shows will be filter according to two date piackers.

 

 

 

Best regards,

Community Support Team _ Phoebe Liu

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Anonymous
Not applicable

Hi @v-yutliu-msft,

 

What is the "modifiedon"  in this case?

DateValue(Text(modifiedon,"[$-en- US]mm/dd/yyyy"))

 

I'm trying to use the filter function, but maybe it's not working because i'm using SP list..

image.png

 

 

Best regards,

Hi @Anonymous ,

Firstly,the "modifiedon" is one filed’s name of my data source,just use for testing,you should replace this with your field’s name.

 

Secondly,if the waring of delegation shows,the data that is dealed with locally will be limited(default500).

The data type of datetime whose data source is SP list used in the function of filter isn't delegable. 

Here is the doc for your reference:

https://docs.microsoft.com/en-us/connectors/sharepointonline/

 

 

Best regards,

Community Support Team _ Phoebe Liu

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (5,732)