Forum Discussion
Lance Alcabasa
Mar 21, 2018Copper Contributor
Provisioning a Lookup Site Column using PowerShell
I am having problems provisioning a look-up column. I am using the following code:
$list = $context.Site.RootWeb.lists.GetByTitle("Ticket Categories")
$rootWeb = $context.Site.RootWeb
$context.Load...
paulpascha
Mar 21, 2018Bronze Contributor
I tried to reproduce the issue but I wasn't able to. Could you try what happens when you remove the "Version" attribute from your Field XML? When I include this attribute in my tests I received the error messsage that the field was modified by another user. I do get a working lookup field however...
The attribute "SourceID" could also be omitted...
A little side note: are you familiar with PnP-PowerShell? It includes a lot of usefull cmdlets, for example Add-PnPFieldFromXml
Lance Alcabasa
Mar 21, 2018Copper Contributor
Hello,
It seems the problem is because of the static ID property. If that is omitted, the error doesn't happen anymore.
Thanks!