3

I am using the PnP commands to add new terms to an existing group, but I am not sure how to set 'other label' fields to add aliases to the term.

I am trying to add a financial accountplan with account and description as the alias/other label.

ie. termname "7215" otherlabel "Internet"

This is the command i use:

New-PnPTerm -Name "7230" -TermSet "Kreditorer" -TermGroup "Kreditorer" -LCID "1033"

Any idea how to set the other labels value?

Other Labels

1 Answer 1

3

You need to use the CreateLabel method to add other labels.

Its not directly available via PnP, so you need to write some more commands to add these labels.

The code necessary for that is as below:

$context = Get-PnPContext
$term = New-PnPTerm -Name "7230" -TermSet "Kreditorer" -TermGroup "Kreditorer" -LCID "1033"
$createLabel1 = $term.CreateLabel("account",1033,$false)
$createLabel2 = $term.CreateLabel("description",1033,$false)
$context.Load($term)
Invoke-PnPQuery

References - Term.CreateLabel method

Modified from - O365 – Create Labels on Managed Metadata Terms using CSOM in PowerShell from a CSV file

1

Your Answer

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

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