How to disable column edit function but allow API to add file

Leung1975 276 Reputation points
2020-09-28T13:18:14.383+00:00

In SharePoint Online Document library, we have metadata with column 1,2,3,4. A REST API is used to add document to the columns. We want column 2,3,4 read only ( column 1 still editable). I used PnP PowerShell to make column 2,3,4 read only, as below,

$Docs= Get-PnPList -Identity Lists/ByItemID
$Number = Get-PnPField -List "ByItemID" -Identity "Number"
$Number.ReadOnlyField = $true
$Number.UpdateAndPushChanges($true)
$Docs.Context.ExecuteQuery();

but this affects REST API to add document to the columns 2,3,4. i.e. REST API cannot add document to the column 2,3,4. Any solution or suggestion on this case? Thanks

Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments

1 answer

Sort by: Newest
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.