Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Query
Suggested answer

Show/Hide Command Bar Buttons using PowerFx

(1) ShareShare
ReportReport
Posted on by 6
Can we set visibility for a command bar button using powerFx based on Logged in user Security Role ?

I have tried This using button component library



but the formula returns boolean correctly based on the roles, but when published not working as expected
Categories:
  • mk1329 Profile Picture
    6 on at
    Show/Hide Command Bar Buttons using PowerFx
    @MSR@08012015 we don't have user id on security roles table
  • Suggested answer
    MS.Ragavendar Profile Picture
    1,126 on at
    Show/Hide Command Bar Buttons using PowerFx
    If the below one doesn't work try with the GUID
     
    If(Lookup(SecurityRoles, 'User Id'=Guid(User().Email)).'Role Name' ='System Admin",true,false)
     
    // Note check the table is accessible in our powerapps and Role Name as per your requirement.
     
    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
  • MS.Ragavendar Profile Picture
    1,126 on at
    Show/Hide Command Bar Buttons using PowerFx
    Hi, 
     
    Try this formula
     
    If(Lookup(UserRolesTblName, UserEmail=User().Email).Roles in ["Admin","Manager"],true,false)
  • mk1329 Profile Picture
    6 on at
    Show/Hide Command Bar Buttons using PowerFx
    @Michael E. Gernaey yes updated my question as well
  • Michael E. Gernaey Profile Picture
    38,415 Super User 2025 Season 1 on at
    Show/Hide Command Bar Buttons using PowerFx
     
    Are you talking for Model Driven Apps?

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 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,513 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,683 Most Valuable Professional

Leaderboard

Featured topics