1

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.

1
  • It needs to be and not &, can you try with this and check ? Commented Jul 30, 2020 at 13:13

2 Answers 2

1

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

3
  • Thanks.... WIll try this .. Commented Jul 30, 2020 at 15:47
  • Any luck with this ? Commented Aug 4, 2020 at 6:34
  • it works .... Thanks Commented Aug 7, 2020 at 8:19
0

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

2
  • Thanks for the reply. This works too. I am aware of this approch. But I do not have term ID handy with me. I have an excel sheet with approx 30,000 records, that contails term value along with other column values. I would have used this solution if I had term ID with me instead of Term value in the excel. Because also term count is more in terms sets, so i cannot get the term ID directly without writing code... Commented Aug 7, 2020 at 8:37
  • So i believe this will be indirect way in my case... Commented Aug 7, 2020 at 8:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.