I first I get a site/list-object and store it in $page.
$category = $page.FieldValues["myTermField"];
In above, I get the term-value in the field "myTermField" and store it in $category.
I then want to set the value of the $category variable to another field. I tried:
Set-PnPListItem -List "SitePages" -Identity @myOtherPage -Values @{"myOtherTermField" = $($category); }
Above does not work. I have tried to put the data in a text-column and it works - I get the term as Label|GUID. However, I want to put all in a managed metadata column and that does not work. I get the error "value cannot be empty".
I also tried:
Set-PnPTaxonomyFieldValue -ListItem @myOtherPage -InternalFieldName "myOtherTermField" -Terms @category
Above does not work. Get the error: "
Set-PnPTaxonomyFieldValue : Cannot bind parameter 'TermId'. Cannot convert the "Microsoft.SharePoint.Client.Taxonomy.TaxonomyFieldValue" value of type "Microsoft.SharePoint.Clien
t.Taxonomy.TaxonomyFieldValue" to type "SharePointPnP.PowerShell.Commands.Base.PipeBinds.GuidPipeBind".
"
Any help?