Forum Discussion

RMDUser1's avatar
RMDUser1
Iron Contributor
Aug 19, 2026

Custom Formatter for Read-Only Fields conditional based on other columns

 

Hello!

 

Does anyone know if it's possible with the fieldsettings, readonly formatting, to make it conditional based on a Person field?  It's a multi people field if that makes a difference? I ideally want to make certain fields read only based on who is viewing it (without having to use a Power App customised form!).

This is what I want (but I know the syntax is likely all wrong!) but not sure if it's possible to use an IF statement with boolean statements?

{

"sections": [

{}

],

"fieldsettings": [

{

"name": "Comments",

"readonly": "=if([$People.email] == me, false, true)"

}

]

}

2 Replies

  • saleha15's avatar
    saleha15
    Brass Contributor

    This looks like a limitation of SharePoint column formatting rather than the IF syntax itself. The readonly property in fieldsettings doesn’t appear to support dynamically evaluating the current viewer ([Me]) against a Person field.

    Also, [me] isn’t a valid column-formatting token for getting the current user’s email.

    If you need the field to be read-only depending on who is viewing the item, you’d generally need to handle it with permissions, Power Apps, or custom SPFx/JavaScript rather than conditional readonly formatting.

    If anyone has found a way to achieve this purely through fieldsettings/JSON formatting, I’d be interested too.

  • The fieldsettings readonly property is not expression-capable. In Microsoft’s current list-form schema it accepts a Boolean value, so the formula string is not evaluated; it cannot switch editability by the current viewer or a multi-person column. Form formatting also changes only presentation, not the item’s permissions, so it must not be used as an authorization control. If this is only a user-interface requirement, customize the form with Power Apps and set the Comments card’s DisplayMode from membership logic. If users must be technically prevented from changing Comments, enforce that separately through SharePoint permissions or redesign the process: restrict item editing, store protected comments in a separately permissioned list, or have a controlled service write the field. Test with a member, not just an owner. Standard JSON can make Comments always read-only with a literal true, but conditional read-only behavior based on the viewer is not supported by fieldsettings