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 / How to disable and edi...
Power Apps
Unanswered

How to disable and edit control on button based on user profile

(0) ShareShare
ReportReport
Posted on by

i have created sharepoint form, in the same screen i added button. now i want to check condition like login  user().email should match with sharepoint record 'Created By' Email of visible record in screen. based on this button should have edit control or else it should disable.

any idea how to do this ?

Categories:
I have the same question (0)
  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at

    HI @venky232 ,
    If you have created a standalone app and have used a gallery to display items, you can use below logic - 
    On DisplayMode property of button - If(LookUp(SPListName, ID=GalleryName.Selected.ID).'Created by'.Email = User().Email, DisplayMode.Edit, DisplayMode.Disabled)
    If you are customizing form, you can use -

    On DisplayMode property of control - If(LookUp(SPListName, ID=SharepointIntegration.SelectedItemID).'Created by'.Email = User().Email, DisplayMode.Edit, DisplayMode.Disabled)

  • venky232 Profile Picture
    on at

    i used this option

    but for any record i selected it showing as disabled button only

  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at

    Try adding the button as a datacard inside the form and use below formula - 
    If(Form1.Mode<>FormMode.New, If(Lower(LookUp(SPListName, ID=ThisItem.ID,'Created by').Email) = Lower(User().Email), DisplayMode.Edit, DisplayMode.Disabled))

  • venky232 Profile Picture
    on at

    button showing as edit mode for non matching username also.

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 325 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard