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

Community site session details

Session Id : YJ9SyPA0M57Xw666c8kAfP
Power Apps - Microsoft Dataverse
Answered

How to get current logged in user details with all the roles he has been assigned in model driven powerapps

Like (0) ShareShare
ReportReport
Posted on 22 Apr 2022 05:17:05 by 7

I have a requirement to get current logged in user details with all roles he has been assigned, based on role, I need to show and hide some fields, How to achieve this in model driven app. 

 

Please let me know, is this achievable or not, if yes then how can we achieve this.

 

Thank you.

  • Verified answer
    Ram Prakash Profile Picture
    5,309 Super User 2025 Season 2 on 26 Apr 2022 at 05:52:34
    Re: How to get current logged in user details with all the roles he has been assigned in model driven powerapps

    Hello @durugappab 

     

    Hope you are doing good,

     

    You can use Xrm.Utility.getGlobalContext().userSettings to get Logged in User and their Security Roles

     

    Xrm.Utility.getGlobalContext().userSettings.roles 

     

    Above mentioned Code will provide you user Security Roles

     

    This Link will help you to show or Hide Button based on Security Roles

     

    https://ajitpatra.com/2020/09/11/d365-ce-get-logged-in-users-security-roles-using-javascript/

     

     

    Please mark as Answer if it is helpful and provide Kudos


    Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
    Follow me on Twitter : @rampprakashd
    Blog : https://microsoftcrmtechie.blogspot.com

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Featured topics