Inside a SPFx web part, I have been trying really hard to list out the labels (red, blue, green) within the Favourite term set. I have not yet been able to achieve this.

Does anybody know how to do this? My brain is melting :(


  public async componentDidMount() {

    const store: ITermStore = taxonomy.termStores.getByName("Taxonomy_O1cHqzMmDZNz4UeaKJLVpA==");

    // get a single term by id
    const term: ITerm = store.getTermById("6a488843-cebc-47b7-8606-e4e165e6fceb");

    const labels: ILabels = term.labels;

    const labelsWithData = term.labels.get();

    { setTimeout(() => {
      console.log('1', store);
    }, 2000); }


enter image description here

1 Answer 1


Sample test code for your reference.

public componentDidMount() {

    var store: ITermStore = taxonomy.termStores.getByName("Taxonomy_hAIlyuIrZSNizRU+uUbanA==");
    var set: ITermSet = store.getTermSetById("70719569-ae34-4f24-81b9-0629d68c05aa");    
    // load the data into the terms instances
      terms.forEach((term: ITerm) => {

enter image description here

enter image description here

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.