Aug 09 2021 04:00 AM
Hi
I have a sharepoint document library where I have added the column "compliance asset id" for applying event-based retention.
I am unable to edit this meta-data in sharepoint against any document I have. How can I edit this field/property?
Thank you
Nov 17 2022 02:20 AM - edited Nov 17 2022 02:21 AM
Sorry for being a bit late, but for anyone out there with the same issue, you cannot edit this value in the GUI, but you can set this value (and any other columns) with PowerShell like this:
Connect-PnPOnline $siteCollURL -CurrentCredentials
$documentRelativeURL = "/Publicering%20Metadata/Sp%C3%B6ket.txt"
$file = Get-PnPFile -Url $documentRelativeURL -AsListItem
Set-PnPListItem -List "Publicering%20Metadata" -Identity $file.Id -Values @{"ComplianceAssetId" = "somevalue"}
You can set a default value for the library like this:
Set-PnPDefaultColumnValues -List "Publicering%20Metadata" -Field “ComplianceAssetId” -Value “123”