web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Apps
Answered

Delegation issues

(0) ShareShare
ReportReport
Posted on by 61

Hi. I have a few delegation warnings in my Leave Request App. Any help would be much appreciated.

 

1) 

If(Weekday(ThisItem.Value) in [2, 3, 4, 5, 6] && !(ThisItem.Value in 'Bank Holidays'.BankHolidayDate),
Filter(
 WaSS_LeaveRequests,
 If( Request_Status="Accepted" || Request_Status="New",
 'Start Date' < ThisItem.NextDay And 'End Date' >= ThisItem.Value)
)
)

WayneSS_0-1718367352912.png

 

2) 

If(Weekday(ThisItem.Value) in [2, 3, 4, 5, 6] && !(ThisItem.Value in 'Bank Holidays'.BankHolidayDate),
Filter(
 WaSS_LeaveRequests,
 'Start Date' < ThisItem.NextDay And 'End Date' >= ThisItem.Value,
 'Employee Email'
)
)

WayneSS_1-1718367404551.png

 

3)

Filter(
 WaSS_LeaveRequests,
 If(
 IsBlank(Filter_EmpName_1.Selected.Value),
 RequestStatus = (StatusChoice).New,
 Name = Filter_EmpName_1.Selected.Value && RequestStatus = (StatusChoice).New
 )
)

WayneSS_2-1718367452460.png

 

Categories:
  • Verified answer
    anandm08 Profile Picture
    1,936 Super User 2024 Season 2 on at

    hi @WayneSS ,

     try this:

    With({
     weekday: Weekday(ThisItem.Value),
     isBankHoliday: !IsBlank(LookUp('Bank Holidays', BankHolidayDate = ThisItem.Value))
    },
    If(weekday >= 2 && weekday <= 6 && !isBankHoliday,
     Filter(
     WaSS_LeaveRequests,
     (Request_Status = "Accepted" || Request_Status = "New") &&
     'Start Date' < ThisItem.NextDay &&
     'End Date' >= ThisItem.Value &&
     'Employee Email' = ThisItem.EmployeeEmail
     )
    )
    )

     

    If(IsBlank(Filter_EmpName_1.Selected.Value),
     Filter(
     WaSS_LeaveRequests,
     RequestStatus = (StatusChoice).New
     ),
     Filter(
     WaSS_LeaveRequests,
     Name = Filter_EmpName_1.Selected.Value &&
     RequestStatus = (StatusChoice).New
     )
    )

     

     

  • WayneSS Profile Picture
    61 on at

    Thank you so much.

     

    I'm improving the code so the calendar only shows the users team mates, rather than every employee in the company. I've got it working with the following code but unfortunately I've created another delegation warning:

    WayneSS_0-1718709947985.png

    With({
     weekday: Weekday(ThisItem.Value),
     isBankHoliday: !IsBlank(LookUp('Bank Holidays', BankHolidayDate = ThisItem.Value)),
     userTeam: LookUp(StaffStructures, Staff_Name = User().FullName, TeamTxt),
     userSubTeam: LookUp(StaffStructures, Staff_Name = User().FullName, SubTeam)
    },
    If(weekday >= 2 && weekday <= 6 && !isBankHoliday,
     Filter(
     WaSS_LeaveRequests,
     (Request_Status = "Accepted" || Request_Status = "New") &&
     'Start Date' < ThisItem.NextDay &&
     'End Date' >= ThisItem.Value,
     LookUp(StaffStructures, Staff_Name = Name).TeamTxt = userTeam &&
     LookUp(StaffStructures, Staff_Name = Name).SubTeam = userSubTeam
     )
    )
    )

     

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 352 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 323

#3
Mohsin Ali Profile Picture

Mohsin Ali 226

Last 30 days Overall leaderboard