0

I'm trying to fix the broken SharePoint online lookup column (site) which is causes problems after migration. Any answers? Thank you!

0

Since the lookup column is broken, I’m afraid you will have to delete and then recreate it.

Where did you migrate the list from and how did you do the migration task?

  1. If the target list is in the same site as the source list, you can use PnP PowerShell to copy the list items. You will need to create a lookup column with correct connection in the target list first.

  2. If the target list is in another site, you can use list templates to do the migration.

Please see the references below:

SharePoint Online: Copy List Items from One List to Another using PowerShell.

How to Move a SharePoint List with Lookup Columns Using List Templates.

0

pls have PnP installed in your machine and run the below ps script in powershell ISE. pls add your listname and site column name. This will fix it. It worked for me.

Connect-PnPOnline -Url https://sharepoint.com/sites/sitecollection -Credentials (Get-Credential) 
$listName="Pages"
$fieldName="YoursitecolumnName"
$lookupListTitle="YourListNameToGetInfoFrom"
$lookupList=Get-PnPList -Identity $lookupListTitle
$field = Get-PnPField  -Identity $fieldName 
[xml]$schemaXml=$field.SchemaXml
$schemaXml.OuterXml
$schemaXml.Field.Attributes["List"].Value = "{" + $lookupList.Id + "}"
$schemaXml.Field.Attributes["ShowField"].Value = "MentionTheFieldyouWantToShowinDropdown"
Set-PnPField -Identity $fieldName -Values @{SchemaXml=$schemaXml.OuterXml}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.