Skip to content

Expand the taxonomy support with methods to search/load terms at store level #892

@jansenbe

Description

@jansenbe

From @gzdev in #849:

Support for new TermStore Rest API _api/v2.1/termStore (used in ModernExperience).

For example: CSOM (Microsoft.SharePoint.Client) offers a way to search for Terms using the one of the following methods:

  • Microsoft.SharePoint.Client.Taxonomy.TermStore.GetTerms(LabelMatchInformation labelMatchInformation)
    RestApi EndPoint: {SiteUrl}/_api/v2.1/termStore/searchTerm(label='{WordsToSearchFor}',languageTag='en-US')?$expand=set
    PnP JS has already implemented the searchTerm method (Link to PnP JS GitHub Report -> searchTerm docs)

  • Microsoft.SharePoint.Client.Taxonomy.TermStore.GetTermsById(Guid[] termIds)
    Get multiple Terms by Id without loading the FieldInfo to get the TermSet.Id to get the TermSet and then getting each Term by Id, ...
    I don't know wether there is any RestApi EndPoint to offer such a way to get multiple terms at once.

  • Also a way getting a term (GetTermById) without knowing the term group would be nice.

Is there a way to get these features in PnP Core SDK?

Btw do anyone know where the documentation of _api/v2.1/termStore clould be found?

Response:

@gszdev , thanks for the feedback, these indeed are useful extensions to have. We're using Microsoft Graph for taxonomy support , will need to check if this is possible using Graph. Using the v2.1 endpoint is not something we support today and (theoretically) this end point is the SharePoint proxy for Graph and one should prefer using Graph over v2.1 whenever possible.

For getting multiple terms in one go batching might be the solution, will investigate that as well.

Update: quick research showed that both requests are not possible today using Microsoft Graph. I'll check with the Graph team owning these features, plan B could be to wrap the CSOM endpoints (like we do for some other missing methods). I'll create a separate issue to track this request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions