1

I try to get all terms in a set that is being used in a SharePoint list column which is a managed metadata column.

The Microsoft Graph API does not give any information about the term set in the ColumnDefinitions and the Microsoft REST API seems to also lack any relevant informations. I know that you can get the terms if you have the group id and the set id, but i dont want to maintain the ids by hand for every list.

Is there any way using C# to get a list of the possible options/terms without already knowing the group id and the set id?

Thank you in advance!

Clarification: I am trying to create an API for internal use by other developer teams in our company. The other teams want to get a list of possible terms a column of managed metadata can contain. I just dont find any clue on the internet about how to make a jump from a list column to a term set.

1 Answer 1

0

As per the documentation the query for getting the term set using C#, which requires the group id and site id,

var graphClient = new GraphServiceClient(requestAdapter);

var result = await graphClient.Sites["{site-id}"].TermStore.Groups["{group-id}"].Sets["{set-id}"].Terms["{term-id}"].GetAsync();

Documnetation:https://learn.microsoft.com/en-us/graph/api/termstore-term-get?view=graph-rest-1.0&tabs=csharp#request

There is another way of doing this in the term store: Create and manage terms in a term set

Hope this helps.

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you for your response. But your answer requires to already know the group-id and the set-id, which i am trying to avoid. I have to work with the site-id, list-id and the column-id to get the possible terms for the column. I also added some clarification to my question. Please tell me, if you need further clarification.
@2Who did you eventually resolve this ? I'm in the same position as you are now. I have the Site and the List, I can extract the columns of a list but not the corresponding Terms..

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.