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

filter by date where source Date/Time and Comparitor is Date Only

I have an issue where i am trying to filter a Gallery Data Source based on a date/time field.

This date time field is from Dynamics 365 and i am comparing it with a DatePicker from PowerApps that the user selects.

The issue, i am assuming, is that the data source is displaying dates as dd/mm/yyyy hh:mm however the date picker is only doing dd/mm/yyyy.

 

When i try to do

DatePicker1.SelectedDate in scheduledstart

it comes up saying theres a service limitation, plus converting them to text values also is service limited.

 

I currently have

scheduledstart = DatePicker1.SelectedDate,

I am not sure what else to try really.

 

Thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
UncountedBrute
Level: Powered On

Re: filter by date where source Date/Time and Comparitor is Date Only

The solution was to do the following:

In an event before the gallery is present to the user:

ClearCollect(localAppointment, Filter(Appointments, <whatever your filters are minus the ones that produce a delegation issue>)).

 

In the Gallery, define the Items property as

Filter(localAppointment, <the filters that did have a delegation issue>)

.

 

Because the collection is now on the local powerapps session, delegation no longer becomes an issue, however efficiency will take a knock so it is important to filter as much as possible before storing it locally.

View solution in original post

5 REPLIES 5
Community Support Team
Community Support Team

Re: filter by date where source Date/Time and Comparitor is Date Only

Hi @UncountedBrute,

 

Agree with that.

DatePicker control would just return the date without time string, so when the query comes to the database, the Type will not match.

Adding functions within the formula will has the formula result in delegation issue.

You may take a try to workaround it by converting the DatePicker value into Datetimevalue as below:

scheduledstart = DateTimeValue(Text(DatePicker1.SelectedDate))

For delegation issue, please check:

Delegable data sources

DateValue, TimeValue, and DateTimeValue functions in PowerApps

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
UncountedBrute
Level: Powered On

Re: filter by date where source Date/Time and Comparitor is Date Only

I tried the work around and sadly didn't work. I'm considering pulling all the data through into a collection and work on it locally so i can hopefully stop that delegation issue.

Anonymous
Not applicable

Re: filter by date where source Date/Time and Comparitor is Date Only

You can always put your date in the correct format using the following function:

 

Text(vardate,"dd//mm/yyyy")

Highlighted
UncountedBrute
Level: Powered On

Re: filter by date where source Date/Time and Comparitor is Date Only

The solution was to do the following:

In an event before the gallery is present to the user:

ClearCollect(localAppointment, Filter(Appointments, <whatever your filters are minus the ones that produce a delegation issue>)).

 

In the Gallery, define the Items property as

Filter(localAppointment, <the filters that did have a delegation issue>)

.

 

Because the collection is now on the local powerapps session, delegation no longer becomes an issue, however efficiency will take a knock so it is important to filter as much as possible before storing it locally.

View solution in original post

Anonymous
Not applicable

Re: filter by date where source Date/Time and Comparitor is Date Only

Thanks for lettings us know the answer!

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps 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

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (4,714)