Forum Discussion

DevSPS's avatar
DevSPS
Copper Contributor
Jun 25, 2025

SharePoint Power Apps Form lock the form field to only created by can edit

I'm trying to get the SharePoint Form fields to be locked for editing for everyone except for the person who created the  item.

the only this I can see wrong is that when I place the Created By Column in the form field it shows:
i:0=.f|membership|email 

where I think the i:0=.f|membership| before the email address is throwing the code off:

I'm using this code:

If(

    User().Email = ThisItem.'Created By'.Email,

    DisplayMode.Edit,

    DisplayMode.View

)

 

Currently it is locked no one can edit the fields not even the person who created the item. (Created By)

 

Is there a way to fix the code to work?

2 Replies

  • michalkornet's avatar
    michalkornet
    Iron Contributor

    Hi DevSPS​  I guess the issue might be something else, maybe one of the email values contains capital letters? In that case, you can use the Lower function on both values to ensure a proper comparison.

    Lower(User().Email) = Lower(ThisItem.'Created By'.Email)

    Another possible issue is that the two values aren't actually the same. I once encountered a situation where one of the values was a technical email address with numbers, while the other was the user's proper email address.

    • DevSPS's avatar
      DevSPS
      Copper Contributor

      Yes, that was what was needed..  the emails are all over the place, so the lower helped out, thanks for verifying and answering 

Resources