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 / Icon Visibility Issue
Power Apps
Answered

Icon Visibility Issue

(0) ShareShare
ReportReport
Posted on by

Hello,

 

I have an icon Visibility question. I want the editing icons to only be visible if the logged in user is the person who created the item. I already set up the SharePoint List level permissions that way. As it is, the icons are visible to everyone whether they submitted the item or not. If a user who didn't create the item clicks on the editing icon, the form opens up and they can enter information. When they attempt to save the changes, they of course don't go through because of how the SharePoint permissions are set. This creates a confusing experience which is why I want to hide the icons unless the logged in person is the either an app admin or the person who created the item. I tried the red formula, but unfortunately it isn't working. All users, whether admins (the isAdmin variable) or not can see the icons.

 

isAdmin || DataSourceInfo('Tool Design Support Requests',DataSourceInfo.EditPermission)

 

My next best guess is to leverage the 'Created By' value or Author (the internal name), but I get red squigglies no matter what I try.

(e.g. varUser='Created By'.DisplayName). If you could help me figure out what I am doing wrong I would really appreciate it! Thanks, Teresa

 

Edit.DeleteIconSS.png

 

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @tagustin2020 

    Yes, I've never validated the concept of the EditPermission against the list with the permission set the way that you have them.  But I believe fairly confidently that the DataSource function will return the fact that they DO have edit permissions in general to the list, not that they have EditPermissions to the individual item.  I base this on the fact that the DataSource is validating the entire datasource, not a record (it has not ability to do that).

     

    So, for your icon, you need to base off of the Created By for the record.  I believe we had you setting a global variable from your main gallery (can't recall the name of it at the moment, so I will call it varSelectedRecord)

    I seem to recall you have the varUser variable with the user info in it.

    So, based on all those assumptions, your formula should be:

         IsAdmin || (varSelectedRecord.'Created By'.Email = varUser.Email) 

     

    Note: Sometimes SharePoint emails differ from the User() email by case, so this is a safer formula:

         IsAdmin || (Lower(varSelectedRecord.'Created By'.Email) = Lower(varUser.Email))

    This will lower the case and compare better.

     

    I hope this is helpful for you.

  • tagustin2020 Profile Picture
    on at

    @RandyHayes 

     

    Hi Randy,

     

    Thanks for coming to my rescue. The formula isn't showing any errors, but my icons are superimposed over one another now. ReqVEform is a local variable that sets the form to View mode. I use it for the Edit and Delete icons. I use !ReqVEform on the Save and Cancel icons as the form is then in Edit mode. varFormTab="Request" makes the form and icons only visible for that particular form tab.  I didn't mention these things before because I didn't think it would have an impact on who could view the icons, but it appears to be impacting the general rules of visibility. Seems like I need another AND or OR piece of logic in there somewhere now that I have introduced that extra piece of OR logic. Can you please help me unravel that piece of it? Thank you, Teresa

     

    varFormTab="Request" && !ReqVEform && isAdmin || (Lower(varRecord.'Created By'.Email) = Lower(varUser.Email))

     

    Save.CancelOverlaySS.png

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @tagustin2020 

    So, order of operations may be a culprit here.  Consider the following:

    varFormTab="Request" && !ReqVEform && 
    (isAdmin || (Lower(varRecord.'Created By'.Email) = Lower(varUser.Email)))

    This reads as following - if the varFormTab is "Request" and ReVEform is Not true and the RESULT of isAdmin is true or the record is created by the current user, then the total result will be true - and thus your icon visible.

     

  • tagustin2020 Profile Picture
    on at

    @RandyHayes 

     

    Thank you Randy, that worked. You're the best! I submitted a request for help on the Design tab email. I haven't heard back from anyone yet. Would you mind taking a look? Here is the post link - https://powerusers.microsoft.com/t5/Building-Power-Apps/Send-automated-email-to-requestor-with-cc-to-a-variable/m-p/747710

     

    Thank you,

    Teresa

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @tagustin2020 

    I put in a reply over there...sorry I missed it yesterday.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 846

#2
Valantis Profile Picture

Valantis 532

#3
Haque Profile Picture

Haque 410

Last 30 days Overall leaderboard