I'm having a strange problem. I try to populate items' property which is of managed metadata (taxonomy) type and the update method doesn't work.
This field has "allow multiple values" property enabled and as long as I send one taxonomy type item to the field it gets stored. When I try to use more than one record and store with update on the item nothing changes.
So, it looks like this:
$item["TaxProp"] = "-1;#TaxItem1|26797705-ef0f-4d49-b7d8-f23112a325aa"
$item["TaxProp"]
After the last line I receive:
WssId Label TermGuid ValidatedString
----- ----- -------- ---------------
56 TaxItem1 26797705-ef0f-4d49-b7d8-f23112a325aa
Then I use $item.Update()
and the data is stored properly in the list item.
But if I try to something like this:
$item2["TaxProp"] = "-1;#TaxItem1|26797705-ef0f-4d49-b7d8-f23112a325aa;#-1;#TaxItem2|c1b9fb3b-8655-4dd8-986c-cab898184d7d"
$item2["TaxProp"]
After the last line I receive:
WssId Label TermGuid ValidatedString
----- ----- -------- ---------------
56 TaxItem1 26797705-ef0f-4d49-b7d8-f23112a325aa
56 TaxItem2 c1b9fb3b-8655-4dd8-986c-cab898184d7d
That is what I want to store, so I call $item2.Update()
After calling update no error occurs and nothing is stored. If I call $item2["TaxProp"]
again now Powershell returns nothing.
What am I doing wrong?