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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / button visible for som...
Power Apps
Unanswered

button visible for some user and hide for some user

(0) ShareShare
ReportReport
Posted on by 525

Hello Power app community support ,

 

I have 2 buttons one is for send mail notification and one is for send emergency ticket on mail notification

 

1 button  i want to hide for users and show to admins only i have more then 30 admin id and DL ID ,

 

2 button i want to hide for admins and show to all users ,

 

how do i set without connect Azure AD ?

 

as i mention i have more then 30 admin ID and 10 DL ID's

 

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    on at

    Hi @mbhatt ,

     

    What is DL ID's ?

     

    I'm thinking of this solution - 

    1. Maintain a list of Admin (Only 1 column - people picker) and connect that list to PowerApps

    2. Check the current logged-in user is in that Admin list and if so, then Show 1st button and Hide another.

    3. E.g. you can take a variable 'IsAdmin'. You need to set its value true/false depending on whether that person is in admin list or not. based on that result you can manage Visible property of button

     

    Let me know if this helps

    Thanks 😀

  • JohnM86 Profile Picture
    590 on at

    To set the visibility of the two buttons in Power Apps without connecting to Azure AD, you can use a combination of the User function and a collection that contains the list of admin IDs and DL IDs.

    1. To hide the first button from users and show it to admins only:
    • Create a collection in your app that contains the list of admin IDs and DL IDs. For example, you can create a collection named Admins with the following formula: ClearCollect(Admins, ["admin1@contoso.com", "admin2@contoso.com", "dl1@contoso.com", "dl2@contoso.com", ...])
    • In the Visible property of the first button, use the following formula: User().Email in Admins.Email This formula checks if the current user's email address is included in the Admins collection. If it is, the button will be visible; otherwise, it will be hidden.
    1. To hide the second button from admins and show it to all users:
    • In the Visible property of the second button, use the following formula: Not(User().Email in Admins.Email) This formula checks if the current user's email address is NOT included in the Admins collection. If it is not included (i.e., the user is not an admin), the button will be visible; otherwise, it will be hidden.

    Note: You will need to update the Admins collection with all the admin IDs and DL IDs that should have access to the first button. Also, make sure that all users have the appropriate permissions to access the second button.

  • mbhatt Profile Picture
    525 on at

    Hello 

    @JohnM86 

     

    I created collection of admin id and i set on button property as you say but as my id is in admin list i am not able to see 

     

    mbhatt_0-1681665017265.png

     

  • JohnM86 Profile Picture
    590 on at

    you could try : If( User().Email in Filter( 'Admin list', Email <> "test@test.com" ), true, false ) change test@test.com for your own email

  • JohnM86 Profile Picture
    590 on at

    or 

     

    If( CountRows( Filter( AdminList, Email = "test@test.com" ) ) > 0, true, false )

  • Verified answer
    WarrenBelz Profile Picture
    153,040 Most Valuable Professional on at

    Hi @mbhatt ,

    I suggest you go back to @Anonymous 's suggestion of maintaining a List (or you will have to hard-code every time a user leaves or arrives.

    You only need one column (you can use the Title field, which is produced automatically) and simply put in all the Admin users' emails. Then all you need on the Visible of the button is

    !IsBlank(
     LookUp(
     YourListName,
     Title = User().EMail
     ).Title
    )

     

    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. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • mbhatt Profile Picture
    525 on at

    Hi 

     

    @WarrenBelz 

    @Anonymous 

     

    It's work for me .

    with admin list i connect in to PowerApps and i use title for admin id and dl id.

     

    as of now this button visible property i set the list and its work but what about other button that i want to hide from this admin list and show to all ? formula for 2nd button hide from admin list and show to all 

    mbhatt_0-1681725807460.png

  • Community Power Platform Member Profile Picture
    on at

    Hi @mbhatt ,

     

    Same logic you can apply. If the current user present in 'Admin' list, hide that button 

  • mbhatt Profile Picture
    525 on at

    Hi

     

    @Anonymous 

    with the same logic getting still visible.

    mbhatt_0-1681739773310.png

     

  • Community Power Platform Member Profile Picture
    on at

    Hi @mbhatt ,

     

    How about removing "!"

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard