Question

I have a list with managed metada column (column name - Proficiency).

I am creating the new record in my list with the following PnP command:

Add-PnPListItem -List "Skill Matrix" -Values @{"PersonnelNumber" = 343; "Skill" = $skill; "Proficiency" = "P0 - No Skills"}

It works perfectly when there is no special character (&) in the skills but it fails for the following Skills because of & sign:

$skill = "SAP Skills|HANA Technical|Basis|Installation & Operations"

I tried to replace it with & but still it didn;t work.

Anyone please suggest me how to implement this.

Thanks.

Was it helpful?

Solution

This is an issue with unicode character and something to do with SharePoint not understanding & character, especially the Taxonomy APIs.

What you can do is to replace & with in your taxonomy label value in your script and it should work. They both look almost the same but are actually different.

You can check a reference here :- Setting managed metadata fields using PnP PowerShell

Difference in pictures -

enter image description here

OTHER TIPS

As I test,@Gautam's way works well. And there is another way to insert metadata.You could insert metadata value with term id,this way could avoid the influence of special symbols. enter image description here

Official document for your reference:

https://docs.microsoft.com/en-us/powershell/module/sharepoint-pnp/add-pnplistitem?view=sharepoint-ps

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top