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 / Show/Hide icon based o...
Power Apps
Unanswered

Show/Hide icon based on entry in SP choice column

(0) ShareShare
ReportReport
Posted on by 321

Afternoon,

 

I have an App whereby there are two levels of admin, maintenance, and full access. I have a SharePoint list containing a choices column called Access and the two choices are simply ‘Full Admin’ and ‘Maintenance Only’.

 

I want to set certain icons within my App to only be shown depending on one of the two access permissions.

 

So,  for example if I have a delete icon, that I only want someone with Full Admin access to see, what would I need to put in the Visible property of the icon?

 

Additionally, what would I put in the Visible property of an icon, if I wanted both people with Full Admin Access and Maintenance Only access to see? This would mean only people with those two permissions could see the icon, but any other users wouldn’t.

 

Thanks in advance.

Categories:
I have the same question (0)
  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    I am assuming you have an email column or person type column in your SharePoint.

     

    Write this on App.OnStart:

    Set(varUser,User());

    Set(IsFAdmin,LookUp(ListName,Email = varUser.Email && Accees.Value = "Full Admin");

    Set(IsMAdmin,LookUp(ListName,Email = varUser.Email && Accees.Value = "Maintenance Only");

     

    The first variable will store your logged-in user's info.

    The second and Third variables will return boolean values meaning True or False.

     

    Let's say you have a delete button. Then set this in the delete button's visible property;

    IsFAdmin

    Because it's a boolean variable you can directly set this in the properties. And if he is the full admin he will see the button.

     

    Let's say there is a button which you want to show only Maintainance admin then set this in the visible property:

     

    IsFAdmin || IsMAdmin

     

  • JimboSey Profile Picture
    321 on at

    @zmansuri thanks for your reply, sadly this didnt seem to work.

     

    I didnt have an email column in my list so I created one, called it email and added all emails into the list.

     

    When I put an icon on the screen and set visible to IsFAdmin it gives the red error.

  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    Share photos of your list and your app code

  • JimboSey Profile Picture
    321 on at

    Hi, here is the existing code in the onstart of the App.

     

    image001 (1).jpg

    The SP list, it literally three columns,’ Name’ (single line of text), UserEmail (single line of text) and Access ‘Choice column’

     

     

    Thanks again

  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    Set(IsFAdmin,LookUp(ListName,Email = varUser.Email && Accees.Value = "Full Admin");

    Set(IsMAdmin,LookUp(ListName,Email = varUser.Email && Accees.Value = "Maintenance Only");

     

    Where are this two lines?

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard