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 / Show/hide buttons base...
Power Apps
Answered

Show/hide buttons based on a form field value, logged in user and be able to "request access"

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have "edit" and "delete" buttons for SharePoint list items in a PowerApp. I would like to hide these buttons if the form field value of "assessment stage" is NOT "draft" AND if the current logged in user is NOT "user A" OR "user B" OR "user C" (hardcoded users who are admins). Then I'll have a "request access" button that will show if the "edit" and "delete" buttons are hidden. The "request access" will be a mailto link to an admin who will add the requested user to a person type column in a SharePoint list. The code should read from the list of users and if the current logged in user matches to one on the list, then the "edit" and "delete" should show. What would be the way to implement this and is there another/better solution?

Categories:
  • Verified answer
    madlad Profile Picture
    2,637 Moderator on at

    In both the edit and delete buttons visible field, use something similar to this code: 

     

    *AssessmentStageField*.Update <> "draft" && 
    (
     currentUser.Email in *UsersSPList*.Email || 
     currentUser.Email in ["UserAEmail", "UserBEmail", "UserCEmail"]
    )

     

     

    Then, for your Request Access Button, your visible could be:

     

    !(
     *AssessmentStageField*.Update <> "draft" && 
     (
     currentUser.Email in *UsersSPList*.Email || 
     currentUser.Email in ["UserAEmail", "UserBEmail", "UserCEmail"]
     )
    )

     

    (the opposite of the edit/delete controls).

     

    As for sending the email with the Request Access button, you could either call a power automate flow, or you can use the Office365Outlook data source connector to send it within your app.

     

    Hope this helps!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 411 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard