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 ?
button showing as edit mode for non matching username also.
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))
i used this option
but for any record i selected it showing as disabled button only
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)
WarrenBelz
146,645
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional