In SharePoint Online, Is there a way to update the ID column(for an existing item) in a list with our value?

We have a SharePoint list where I want to update the ID column value with my own value. I just want to update it for one item as is it impacting one of our solution.

有帮助吗?

解决方案

No, this is not possible.

Even after setting the ReadOnlyField property of the field to false you will get an error when trying to update it:

❯ Set-PnPListItem -List TestList -Identity 1 -Values @{ID=20}
Set-PnPListItem : This field cannot be updated.

其他提示

Short answer is SharePoint List Item Id is read only, can't be updated with custom value.

If you are using SharePoint Online, please check the CSOM ListItem class here:

ListItem.Id property

The ListItem Id is generated after the item was created by the SharePoint system.

许可以下: CC-BY-SA归因
scroll top