Get Object.Label of Managed Metadata #595
-
Hey, I feel like a guest who comes back every week. So sorry about it xD When I use this approach (item is if (item.Properties.Values.TryGetValue(propertyName, out var value))
document.Properties.Add(propertyName, value); I get this value for a managed metadata property: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 25 replies
-
@LegendaryB , when reading the list holding the items I assume you've also loaded the list fields as mentioned here https://pnp.github.io/pnpcore/using-the-sdk/listitems-intro.html#reading-list-items? If so then a managed metadata field should be represented by an Now you can also simply split the string yourselves (label = Foo, Id = b704...)... |
Beta Was this translation helpful? Give feedback.
@LegendaryB , when reading the list holding the items I assume you've also loaded the list fields as mentioned here https://pnp.github.io/pnpcore/using-the-sdk/listitems-intro.html#reading-list-items? If so then a managed metadata field should be represented by an
IFieldTaxonomyValue
or anIFieldValueCollection
ofIFieldTaxonomyValue
for multi taxonomy fields. Which should give you the taxonomy label and id (https://pnp.github.io/pnpcore/api/PnP.Core.Model.SharePoint.IFieldTaxonomyValue.html).Now you can also simply split the string yourselves (label = Foo, Id = b704...)...