0

I am using pnp sp to retrieve the termset, i am using this:

const store: any = await taxonomy.termStores.getByName("Taxonomy_9D1X5aueEcT7a3LKqetQKw==");
        const sets: ITermSets = taxonomy.termStores.getByName("termstore name")
                .getTermSetsByName("Division", 1033);
        console.log(sets);

        return sets;

i have also tried this, from the documentation:

// note that you can also use instances if you wanted to conduct multiple operations on a single store
const store: ITermStore = taxonomy.termStores.getByName("Taxonomy_v5o/SbcTE2cegwO2dtAN9l==");
const set: ITermSet = store.getTermSetById("0ba6845c-1468-4ec5-a5a8-718f1fb05431");

but i dont see anything that i can use from the returned value?

enter image description here

i need to retrieve the values from this Term Set: (Division)

enter image description here

1 Answer 1

0

In the documentation there's an example:

import { taxonomy, ITermStore, ITermSet } from "@pnp/sp-taxonomy";

const store: ITermStore = taxonomy.termStores.getByName("Taxonomy_v5o/SbcTE2cegwO2dtAN9l==");

const set = store.getTermSetsByName("my set", 1031).getById("0ba6845c-1468-4ec5-a5a8-718f1fb05431");

const setWithData = store.getTermSetsByName("my set", 1031).getByName("my set").get();

Notice the extra .getByName("my set").get(); after the getTermSetsByName call. So, I assume in your case you should add add an extra get() call.

Haven't tested it though.

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.