I just create the 2 sharepoint lists.
one for collecting all the leave requests ad one for the leave balance like this.
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.
but I don't know how to make it works for all users.
Example
User A
User B
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.
Solved! Go to Solution.
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
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
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
@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
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.
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
Got it Thank you very much, looks like on this part I need to manually create it without using the gallery lol.
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
Oh I got it, sorry for my dumb 😅
User | Count |
---|---|
252 | |
106 | |
96 | |
50 | |
39 |