Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Suggested answer

Get user ID of the current logged in account, add it to other sharepoint list

Like (0) ShareShare
ReportReport
Posted on 11 Aug 2024 17:17:22 by 8
Hello Folks,
 
I'm trying to get the user ID based from the current logged in user, that will be from tbl_employee.
 
I have another list which is named tbl_eval_content, of the column here is related with the tbl_employee, emp_ID column.
 
Now, I want to get the user ID from tbl_employee and fetch that ID then add it to tbl_eval_contents. 

Below is my code:
 
Set(CurrentUserEmail, Office365Users.MyProfile().Mail);
Set(CurrentUserID, LookUp(tbl_employee, User_email = CurrentUserEmail, ID));
 
Patch(
    tbl_eval_content,
    Defaults(tbl_eval_content),
    {
        emp_id: CurrentUserID,
        Punctual: Value(dr1.Selected.Value),
        // Convert text to number
        Biometrics: Value(dr2.Selected.Value),
        // Convert text to number
        LeaveForm: Value(dr3.Selected.Value),
        // Convert text to number
        OTForms: Value(dr4.Selected.Value),
        // Convert text to number
        STER: Value(dr5.Selected.Value),
        // Convert text to number
        TakeBreak: Value(dr6.Selected.Value),
        // Convert text to number
        ProperUniform: Value(dr7.Selected.Value),
        // Convert text to number
        WearingID: Value(dr8.Selected.Value),
        // Convert text to number
        Grooming: Value(dr9.Selected.Value),
        // Convert text to number
        Station: Value(dr10.Selected.Value)
// Convert text to number
    }
)
Categories:
  • Suggested answer
    rpatricio Profile Picture
    8 on 11 Aug 2024 at 21:52:40
    Get user ID of the current logged in account, add it to other sharepoint list
    Hello FLMike,
     
    Thank you for replying to my post.
     
    Once I hit the submit button, it doesn't get or return the ID of the employee.
     
     
  • Suggested answer
    Michael E. Gernaey Profile Picture
    42,080 Super User 2025 Season 1 on 11 Aug 2024 at 19:02:49
    Get user ID of the current logged in account, add it to other sharepoint list
    Hi,
     
    I do not see a question here at all.
     
    What are you asking for. Your code looks fine. Although I would use User().Email Instead of looking up their profile and grabbing that one.
     
    If you are saying this doesnt work, it could be because the UPN is actually NOT the email you are logging in with, in which case on the users profile page in Outlook, you would see 2 different emails.
     
    Anyway.. please ask a question.

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 110 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 75

#3
Michael E. Gernaey Profile Picture

Michael E. Gernaey 52 Super User 2025 Season 1

Overall leaderboard