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 Team
Community Support Team

Re: Filter a Gallery by tow DatePickers

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 Team
Community Support Team

Re: Filter a Gallery by tow DatePickers

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

Highlighted
Anonymous
Not applicable

Re: Filter a Gallery by tow DatePickers

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,

Community Support Team
Community Support Team

Re: Filter a Gallery by tow DatePickers

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,872)