Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building 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:
  • venky232 Profile Picture
    on at
    Re: How to disable and edit control on button based on user profile

    button showing as edit mode for non matching username also.

  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at
    Re: How to disable and edit control on button based on user profile

    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
    Re: How to disable and edit control on button based on user profile

    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
    Re: How to disable and edit control on button based on user profile

    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)

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,645 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard