An API that connects multiple Microsoft services, enabling data access and automation across platforms
Nevermind Can't delete
We have a sharepoint list that has a custom read-only field in it that is created programmatically when the item is created and should never be changed after. We were originally using an InfoPath form which calculated the field value and set it as part of creating the new list item. We tried to use a PowerApps form to create the new list items, and it was created the same way in the PowerApps app, where the app calculated the field value and set it on the new item.
We are now trying to make a new .NET web application that interacts with the Sharepoint list to create the new list items, using the Graph API. The problem is that we can't set the read-only field on the new list item when using the c# Graph SDK's graphServiceClient.Sites[siteId].Lists[listId].Items.PostAsync(requestBody) method. This returns a "field is read-only" error for the field that is read-only, but it makes no sense for that restriction to be held during the Post of a new item. All of the answers I've found are "change the read-only status on the column to false before and then back to true after", but almost every answer is about system fields, not to mention this is a horrible idea because it requires everyone who would use the web application to have permissions to change the columns on the list on sharepoint, since the API uses delegated permissions.
Is there a better way to handle this?
Somehow I was misreading what field was getting the error, and I cna't figure out how to delete this.