cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AntonioHAC
Level: Powered On

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 @AntonioHAC ,

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.
3 REPLIES 3
Community Support Team
Community Support Team

Re: Filter a Gallery by tow DatePickers

Hi @AntonioHAC ,

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.
Highlighted
AntonioHAC
Level: Powered On

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 @AntonioHAC ,

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
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, August 21st at 8am PDT

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 44 members 3,968 guests
Please welcome our newest community members: