Workaround to make a SharePoint Online column as ready-only column

Using calculated fields and JSON formatting

Steps:

1. Create a calculated field for the Lookup or People column you want to make as read-only with formula reference to any single line of text field.

2. Apply JSON formatting to the calculated field to display the column value of the Lookup or People column. The JSON formatting will apply in the quick edit view. 

Example:

I have a lookup column "DU" which I want to be readonly, so I have created a calculated column hidden_DU with formula reference to the Title field. And applied the below JSON formatting to the hidden_DU field. 

JSON formatting: 

{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", 

"elmType": "div", 

"style": { "flex-wrap": "wrap", 

"display": "flex" }, 

"txtContent": "[$DU.lookupValue]" }


Comments

Popular posts from this blog