Hi Power Apps Community,
I am working on a Power Apps application that interacts with a SharePoint calendar list. I am facing challenges with delegation warnings when trying to filter events by a specific date. Here’s what I’m trying to achieve, what I’ve tried so far, and the errors or issues I’ve encountered. Any assistance or guidance would be greatly appreciated!
Objective:
- Display only today's events in a gallery.
- Allow navigation between dates using previous and next buttons.
What I’ve Tried:
1. Initialize the Date Variable in `OnStart`:
Set(selectedDate, Today());
```
2. Filter the Gallery's Items Property:
I tried several approaches:
- Using a simple date comparison:
Filter(
CalendarEvents,
EventDate >= selectedDate && EventDate < DateAdd(selectedDate, 1, Days)
)
Result: Delegation warning encountered.
- Using `Year`, `Month`, and `Day` functions:
Filter(
CalendarEvents,
Year(EventDate) = Year(selectedDate) &&
Month(EventDate) = Month(selectedDate) &&
Day(EventDate) = Day(selectedDate)
)
Result: Delegation warning encountered.
- Using `LookUp` and `IsBlank`:
Filter(
CalendarEvents,
!IsBlank(LookUp(CalendarEvents, EventDate >= selectedDate && EventDate < DateAdd(selectedDate, 1, Days)))
)
Result: Delegation warning encountered.
- Using `With` to create date range:
With(
{
startOfDay: DateValue(Text(selectedDate, "[$-en-US]yyyy-mm-dd")),
endOfDay: DateAdd(DateValue(Text(selectedDate, "[$-en-US]yyyy-mm-dd")), 1, Days)
},
Filter(
CalendarEvents,
EventDate >= startOfDay && EventDate < endOfDay
)
)
Result: Delegation warning encountered.
3. Navigation Buttons:
- Previous Day Button's `OnSelect`:
Set(selectedDate, DateAdd(selectedDate, -1, Days));
- Next Day Button's `OnSelect`:
Set(selectedDate, DateAdd(selectedDate, 1, Days));
4. Displaying the Selected Date:
Text(selectedDate, "[$-en-US]dd mmm yyyy")
Errors/Issues Encountered:
- Delegation warnings consistently appear regardless of the approach.
- Unable to filter and navigate events by date without encountering delegation issues.
Request for Assistance:
- How can I filter calendar events by a specific date in a fully delegable manner using a SharePoint calendar list?
- Are there any best practices or alternative approaches to achieve this functionality without delegation warnings?
Thank you in advance for your help!