Skip to main content

Notifications

Community site session details

Community site session details

Session Id : uDdMz217cfSCBSAjLsLX95
Power Apps - Power Query
Suggested answer

Show/Hide Command Bar Buttons using PowerFx

Like (1) ShareShare
ReportReport
Posted on 14 Mar 2025 05:21:31 by 2
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:
  • Suggested answer
    MSR@08012015 Profile Picture
    542 on 14 Mar 2025 at 07:27:56
    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
  • MSR@08012015 Profile Picture
    542 on 14 Mar 2025 at 07:24:23
    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
    2 on 14 Mar 2025 at 06:58:28
    Show/Hide Command Bar Buttons using PowerFx
    yes updated my question as well
  • Michael E. Gernaey Profile Picture
    35,902 Super User 2025 Season 1 on 14 Mar 2025 at 06:16:14
    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

Thomas Rice – Community Spotlight

We are honored to recognize Thomas Rice as our March 2025 Community…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community

Announcing Our 2025 Season 1 Super Users!

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

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,508 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,382 Most Valuable Professional

Leaderboard

Featured topics

Loading started
Loading complete