Hier erstelle ich ein neues Feld âRelated Documentsâ mit dem ich verwandte Dokumente zu einem Dokument angeben kann. Das geht nicht Ăźber die Oberfläche (âNameâ bzw. âFileLeafRefâ ist hier nicht auswählbar), daher lege ich es per Powershell an.
Connect-PnPOnline "https://tenant.sharepoint.com/sites/meineseite" -Interactive
$ListName="Documents"
$LookupFieldName="RelatedDocument"
# Add the field to the list
Add-PnPField -List $ListName -Type Lookup -DisplayName $LookupFieldName -InternalName $LookupFieldName -AddToDefaultView
# Set the lookup list for the field and set the lookup field to "FileLeafRef"
Set-PnPField -List $ListName -Identity $LookupFieldName -Values @{LookupList=(Get-PnPList $ListName).Id.ToString(); LookupField="FileLeafRef"}