The Startdate column is a date type and the date format in the app is "yyyy-mm-dd" which is the Swedish format. I guess that date format of the PowerApps app may depend on what language ths operating system is set to, right?
I have tried the code you provided for the Gallery Items and then, like you state, I end up with a delegation warning concerning large data sets. I tried ignoring it, published the app again and ran it and the list of items showed up empty (the list has six items).
Could this be related to the date format I'm using?
Just an update -- Please modify your formula within the Items property of the Gallery to following:
SortByColumns( Filter( 'Events VU'; StartsWith(Header; TextSearchBox1.Text); Value(Text(Startdate, "yyyymmdd")) > Value(Text(Today()-8,"yyyymmdd")) /* <-- Modify formula here */ ); "Title"; If(SortDescending1; Descending; Ascending) )
then check if the issue is solved.
In addition, if you want to get rid of the Delegation warning issue within your app, please take a try with the following workaround:
Set the OnVisible property of the first screen of your app to following:
ClearCollect(RecordsCollection, 'Events VU')
Set the Items property of the Gallery to following:
Value(Text(Startdate, "yyyymmdd")) > Value(Text(Today()-8,"yyyymmdd")) /* <-- Modify formula here */
If(SortDescending1; Descending; Ascending)
I tried the first segment of code that you provided in your last post. I get the delegation warning but I also see error boxes. Seems like the data source cannot be found? Se screenshot below:
It feels like I'm doing some basic mistake here...
Hi - I came across this same problem now and I used the same approach I mentioned but I converted the current date to a number and added a number column in my SharePoint List. I managed to avoid delegation. You'll need to declare a Cut-Off Date on start of the application.
The increment is in milliseconds, 86,400,000 per day. It's quite different to how Excel converts a date to a number.
On my main screen, I set this on the 'OnStart' properties.
//I want to display only the last 7 days.
Set(CutOffDate,Value(Today() - 7))
On my SharePoint List, I added a Number column (I'll call it DateStamp. On the DateStamp data card, I put a Label control and on the Text property I put Value(Today()) (If you have a date control you can also use that, the formula would be Value(DateControl.SelectedDate).
My Gallery would have this formula then:
DateStamp >= CutOffDate
It filters based on the number column called DateStamp and because it's a number it doesn't give a delegation warning.