cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
VikasNagaraj
Helper IV
Helper IV

Leave request app Approval dashboard

Hi,

Hope you are well.

 

I have created a leave request app everythig is working fine other than the Approval Dashboard. The gallery does not display any requests for my manager Dont know whats wrong, i am using the below code. 

Filter(
'Leave Request',
(Status.Value = "Pending Manager Approval" && Manager.Email = User().Email) || (Status.Value = "Pending HR Approval" && HR.Email = User().Email)
)

VikasNagaraj_0-1638186083722.png

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions

@VikasNagaraj Just double check that the userEmail variable has the correct email address and then this should work,

Filter(
'Leave Request',
(Status.Value = "Pending Manager Approval" && Manager.Email = userEmail) || (Status.Value = "Pending HR Approval" && HR.Email = userEmail)
)

View solution in original post

24 REPLIES 24
Nogueira1306
Community Champion
Community Champion

Filter(
'Leave Request',
(Status.Value = "Pending Manager Approval" ,Manager.Email = User().Email) || (Status.Value = "Pending HR Approval", HR.Email = User().Email)
)

 

If you need additional help please tag me in your reply and please like my reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️!

Best regards,
Gonçalo Nogueira

Check my LinkedIn!

Check my User Group (pt-PT)!

Last Post on Community

My website!

zmansuri
Super User
Super User

Take a label to debug. Check what's the output of Manager.Email and User().Email. Sometimes they are different sometimes they are in different case.

Hi @Nogueira1306 

Thanks for replying, I entered your code and i have errors. Please find the below screenshot.

VikasNagaraj_0-1638188091725.png

 

Hi @zmansuri 

I tried User().email, it brings up my email ID and i get an error for manager.email.

https://docs.microsoft.com/en-US/powerapps/maker/canvas-apps/functions/function-filter-lookup

 

Check that link, it might help you

 

If you need additional help please tag me in your reply and please like my reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️!

Best regards,
Gonçalo Nogueira

Check my LinkedIn!

Check my User Group (pt-PT)!

Last Post on Community

My website!

CNT
Super User
Super User

@VikasNagaraj To start with make sure you have some matching records. To do this hardcode some email address and try,

Filter(
'Leave Request',
(Status.Value = "Pending Manager Approval" && Manager.Email = "user1@mycompany.com") || (Status.Value = "Pending HR Approval" && HR.Email = "user2@mycompany.com")
)

@CNT Thank you very much for the reply.

 

I have done the Hard coding as you said, they are able to see the request now, I dont know why the earlier code was not working. When they click on approve or reject they get this error.

VikasNagaraj_0-1638271364098.pngVikasNagaraj_1-1638271481948.png

Thank you.

@VikasNagaraj The Approval part is a different story. For the benefit of the community, I think we'll have to deal it separately.

 

Now try this,

With({varUserEmail:TrimEnds(User().Email)},

Filter(
'Leave Request',
(Status.Value = "Pending Manager Approval" && varUserEmail in Manager.Email) || (Status.Value = "Pending HR Approval" && varUserEmail in HR.Email)
))

@CNT 

I used the code given, i have a delegation warning.

VikasNagaraj_0-1638276842048.png

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,174)