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 Platform Community / Forums / Power Apps / Leave Request Template...
Power Apps
Answered

Leave Request Template with sharepoint list

(0) ShareShare
ReportReport
Posted on by 154

I just create the 2 sharepoint lists.

one for collecting all the leave requests ad one for the leave balance like this.

mmchx_0-1637140114227.png

But I have a problem that, It works only for one user.

I mean on my Leave request app, I want the users to see how many leave balances each type that they have left. like this.

mmchx_1-1637140302742.png

 but I don't know how to make it works for all users.

Example

User A

  • sick leave balance (maximum) = 10, Annual leave balance (maximum) = 20
  • already request the annual leave 4 days ->> current annual leave balance = 20 - 4 =16    

User B

  • sick leave balance (maximum) = 10, Annual leave balance (maximum) = 20
  • already request the sick leave 1days ->> current sick leave balance = 10-1 = 9

I don't know how can I make the sharepoint know that the current annual leave btw User A & User B is different , also how can I update the data for showing on the Power apps.

 

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    155,775 Most Valuable Professional on at

    Hi @mmchx ,

    You need the user's email in the List and then compare this with the built-in function User().Email

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • mmchx Profile Picture
    154 on at

    So I need to create the user's email column on the ListTypeofLeave and another column to store the leave days that user requests right? 

    I'm sorry that I don't get how can I compare with the built-in function User().Email. 
    since power apps don't store anything

  • WarrenBelz Profile Picture
    155,775 Most Valuable Professional on at

    @mmchx ,

    I am assuming ListTypeofLeave is a List? If you had a field called UserMail storing the User's email and another field called LeaveDays, you would get the value of that field in the current user's record with 

    LookUp(
     ListTypeofLeave,
     UserMail=User().Email
    ).LeaveDays

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

  • mmchx Profile Picture
    154 on at

    Yes, ListTypeofLeave is a List. I see appreciate it!
    like this right? then if I want to the number of the current balance, I just calculate in power apps and update the value via power automate.

    mmchx_0-1637159282178.png

     

  • Verified answer
    WarrenBelz Profile Picture
    155,775 Most Valuable Professional on at

    Hi @mmchx ,

    In your case, you have the user's name (the field would be better called NameUser), but disregarding this

    LookUp(
     typeofleave,
     UserMail=User().FullName
    ).Current_AnnualLeave

    would get the current annual leave.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

  • mmchx Profile Picture
    154 on at

    Got it Thank you very much, looks like on this part I need to manually create it without using the gallery lol. 

    mmchx_0-1637199805163.png

     

  • WarrenBelz Profile Picture
    155,775 Most Valuable Professional on at

    @mmchx ,

    Is this solved now - if so please mark as solution.

  • mmchx Profile Picture
    154 on at

    arr, I have a problem with the lookup 

    based on your code, I set OnStart

    set(currentUser,User().mail)

      the power apps stored the user's mail correctly without error.

    but when I applied to the Label like this

    LookUp(
     typeofleave,
     NameUser= CurrentUser
    ).Current_AnnualLeave

    It has the error on the equal sign "Incompatible types for comparison. These types can't be compared: Record, Text."

    Even I change the currentUser to Office365Users.MyProfileV2().mail

  • mmchx Profile Picture
    154 on at

    Oh I got it, sorry for my dumb 😅

  • ElvinV Profile Picture
    31 on at

    I am confused, were you able to make it work?

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 494

#2
WarrenBelz Profile Picture

WarrenBelz 352 Most Valuable Professional

#3
11manish Profile Picture

11manish 323

Last 30 days Overall leaderboard