cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Meneghino
Level 10

Re: Gallery Filter by a date (SharePoint List) - 'Part of this filter formula cannot be evaluated re

Hi @PaulD1

The issue is that Today() is not delegable, if that makes any sense.

I hate putting values in hidden labels to refer to them, so my suggestion would be to use this in the OnStart property of the first screen:

Set(MyTodayVar, Today())

Then use MyTodayVar anywhere you would use Today and it will be delegated.

Of course this value will not update if the app is kept open overnight, but you can have a timer refresh this variable every few hours if you really want, although I would not recommend that.

Don't forget that you will need to close and open the app for the variable to be set in Studio or web designer, as the OnStart will only fire once.

Super User
Super User

Re: Gallery Filter by a date (SharePoint List) - 'Part of this filter formula cannot be evaluated re

Awesome - thanks very much indeed Meneghino. Assigning the formula result to a variable and then using that variable in the filter seems to do the trick!

DaveShepherd
Level: Power Up

Re: Gallery Filter by a date (SharePoint List) - 'Part of this filter formula cannot be evaluated re

I too wanted to Filter based on today's date against a SharePoint list date field, within PowerApps

I dont know if this is the best way, but seems to be working for my scenario.(PowerApp will be the only application adding new records to the SP list)

My hack to get around the blue dot and delegation was as follows:

In the SharePoint list create "Single line of text" column e.g DateText - NOT a Calculated column.

In the PowerApp OnStart, create a new variable  -

Set(TodaysDate, Today())

 

In the PowerApp, when creating a new record, format Default property of the DataCardValue of DateText field using

 

•Text(TodaysDate, "[$-en-US]yyyymmdd")

 

After saving the record away, to retrieve into the gallery I used.

Filter('Operators Feedback', DateText = Text(TodaysDate, "[$-en-US]yyyymmdd"))

 

There a now no blue dot warnings and returns the correct items from the list.

Hope this makes sense

Highlighted
Emilio
Level: Powered On

Re: Gallery Filter by a date (SharePoint List) - 'Part of this filter formula cannot be evaluated re

This solution saves me.

Thanks 

Emilio Rinaudo
LucasVida
Level: Power Up

Re: Gallery Filter by a date (SharePoint List) - 'Part of this filter formula cannot be evaluated re

Nice solution ! Worked for me. Thanks !

MatthewMcDMVP
Level: Powered On

Re: Gallery Filter by a date (SharePoint List) - 'Part of this filter formula cannot be evaluated re

I took a slightly different approach since I was using the standard SharePoint Created column for comparison. Also, I needed a toggle to go between "Filter Today" and "Show All".

 

In the App I have a filter toggle button OnSelect defined:

Set(FilterAllDate, DateAdd( Today(), 1 ));
Set(FilterTodayDate, DateAdd( Today(), 0 ));
UpdateContext({FilterToday: !FilterToday})

In my Data Items I have:

SortByColumns(Filter(CheckIn, StartsWith(Title, TextSearchBox1.Text) && If(FilterToday,Created >= FilterTodayDate,Created<=FilterAllDate)), "Created", If(SortDescending1, Descending, Ascending))
SergiP
Level: Powered On

Re: Gallery Filter by a date (SharePoint List) - 'Part of this filter formula cannot be evaluated re

hi,

 

I don't know if anything has been changed since your answers but nowadays as soon as I include any date field in the filter it is not delegable anymore.

Even when I use the trick of asigning the today() to a variable.

Anonymous
Not applicable

Re: Gallery Filter by a date (SharePoint List) - 'Part of this filter formula cannot be evaluated re

hi @DaveShepherd,

thank you for your solution, i do the same thing, i create a new column in the sharepoint list and i set the TodayDate variable but instead of puting = operator in the filter function i tried to use >= operator but it does not accept it. any ideas ?!

Helpful resources

Announcements
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 Kudoed Authors (Last 30 Days)
Users online (4,294)