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 / ROLE BASED CONTROL - P...
Power Apps
Unanswered

ROLE BASED CONTROL - POWER APP

(0) ShareShare
ReportReport
Posted on by 2

I have an app with the mainscreen (landing page) Screen1. It has two buttons - Admin and User. These are on a sharepoint intended to control user access.

I want the Admin button to only be visible if the user is an Admin but I am not succeeding at all. 
I applied this code to App:
Set(currentUser, User());
Set(
currentUserRole,
LookUp(
'User Access',
'User'.Email = currentUser.Email,
   Role
    )
);

 

And I tried applying this code:
currentUserRole = "Admin" - to the visible property of the admin button but it did not work. 

Please assist. I am fairly frustrated.

Vumboni_Msimang_0-1716391290730.png

 


 

Categories:
I have the same question (0)
  • elseb Profile Picture
    774 Moderator on at

    hi, this is how i tackle the same task:

     

    I'm saving User().EntraObjectId in the sharepoint (emails can be unreliable when someone changes name et.) 

    so have two columns minimum: user_id and user_role

    then on visible of the control i put:

    If(LookUp(users_list, user_id=User().EntraObjectId).user_role="admin", true,false)

     

    i actually use numbers for role so you can change the name retrospectively byt you can use hardcoded names like"admin" if you like.

  • Vumboni_Msimang Profile Picture
    2 on at

    I keep having issues with the = sign.

  • elseb Profile Picture
    774 Moderator on at

    you need to elaborate, what kind of issues?

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

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard