
Hi everyone
I have got an app which uses a SharePoint list to store data about actions that need to be completed. One of the columns in this list is a target date for the action to be completed and I want users to be able to filter by this date using the dropdown below:
To do this I've used the formula below in the Items property of the gallery that holds the actions list:
Filter(ActionList,
dd_DateFilter.Selected.Value = "All"
||
Switch(dd_DateFilter.Selected.Value,
"Today", TargetDate = Today(),
"Next 7 days", (TargetDate <= Today()+7) && TargetDate > Today(),
"Overdue", TargetDate < Today()
)
)
This works fine and displays the correct records in the gallery but due to the Switch statement I'm getting a delegation warning. I can see that using an if or switch in a filter isn't delegable so I wondered if anyone could see a way of getting a similar result without using either of these, as so far I haven't been able to? I need to avoid any delegation warnings as when this app is in production the list will be over 2000 items.
Any help or pointers would be gratefully received. Thanks in advance.
You could move the Switch out of the Filter statement to get rid of the delegation warning, something like
Switch(dd_DateFilter.Selected.Value,
"All", ActionList,
"Today", Filter(ActionList, TargetDate = Today())
)