Question

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.

Était-ce utile?

La 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.

Autres conseils

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange
scroll top