Skip to main content
Post Undeleted by Carolina Bauque
added 661 characters in body
Source Link

You areYes, you're able to create a Lookup column from another site.

Here you have You can use the script bellow in PowerShell. It'll create a full example by Benjamin NiaulinCustomer lookup column in your Project list. Before running the script you'll need to update the url and list names with yours.

#Get the webs and lists
$web1 = Get-SPWeb http://sitecollection/site1/
$web2 = Get-SPWeb http://sitecollection/site2/
$projectList = $web1.Lists.item("Projects")
$customerList = $web2.Lists.item("Customers")

#Add a lookup field
$projectList.fields.AddLookup("Customer", $customerList.id, "false")

#Get the created lookup field
$LookupField = $projectList.Fields["Customer"]

#Set the lookup web ID and lookup field
$LookupField.LookupWebId = $customerList.ParentWeb.ID
$LookupField.LookupField = $customerList.Fields["Title"].InternalName
$LookupField.Update();

You are able to create a Lookup column from another site.

Here you have a full example by Benjamin Niaulin

Yes, you're able to create a Lookup column from another site. You can use the script bellow in PowerShell. It'll create a Customer lookup column in your Project list. Before running the script you'll need to update the url and list names with yours.

#Get the webs and lists
$web1 = Get-SPWeb http://sitecollection/site1/
$web2 = Get-SPWeb http://sitecollection/site2/
$projectList = $web1.Lists.item("Projects")
$customerList = $web2.Lists.item("Customers")

#Add a lookup field
$projectList.fields.AddLookup("Customer", $customerList.id, "false")

#Get the created lookup field
$LookupField = $projectList.Fields["Customer"]

#Set the lookup web ID and lookup field
$LookupField.LookupWebId = $customerList.ParentWeb.ID
$LookupField.LookupField = $customerList.Fields["Title"].InternalName
$LookupField.Update();
Post Deleted by Carolina Bauque
Source Link

You are able to create a Lookup column from another site.

Here you have a full example by Benjamin Niaulin