In this super short post I’ll show how to use Powershell and CSOM (Client-side Object Model) to set the value of a multi-value Lookup field column in a list or library.
To set the value for a single-value column you just need to set the column value to a FieldLookupValue instance, note that only the LookupId property can be set, so you have to know/get what the list item ID of the target lookup item is.
For a multi-value column, you have to supply a
FieldLookupValue array ~ in C# this is easy enough, but in Powershell it’s not obvious how to do it.
The trick is to create a vanilla
Object array and add FieldLookupValue instance to it, then to convert that to an
FieldLookupValue array, and use that as the item column value.
Here’s the code;