Skip to content

Commit

Permalink
Merge pull request #2885 from bcameron1231/v4-Taxonomy
Browse files Browse the repository at this point in the history
V4 Graph Taxonomy
  • Loading branch information
juliemturner authored Jan 17, 2024
2 parents 0229d8e + 4ab1688 commit 3f83b07
Show file tree
Hide file tree
Showing 9 changed files with 611 additions and 1,039 deletions.
442 changes: 442 additions & 0 deletions docs/graph/taxonomy.md

Large diffs are not rendered by default.

11 changes: 2 additions & 9 deletions docs/sp/column-defaults.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,23 +216,16 @@ import { spfi } from "@pnp/sp";
import "@pnp/sp/webs";
import "@pnp/sp/folders";
import "@pnp/sp/column-defaults";
import "@pnp/sp/taxonomy";

const sp = spfi(...);

// get the term's info we want to use as the default
const term = await sp.termStore.sets.getById("ea6fc521-d293-4f3d-9e84-f3a5bc0936ce").getTermById("775c9cf6-c3cd-4db9-8cfa-fc0aeefad93a")();

// get the default term label
const defLabel = term.labels.find(v => v.isDefault);

// set the default value using -1, the term id, and the term's default label name
await sp.web.lists.getByTitle("MetaDataDocLib").rootFolder.setDefaultColumnValues([{
name: "MetaDataColumnInternalName",
value: {
wssId: "-1",
termId: term.id,
termName: defLabel.name,
termId: "{term Id}",
termName: "{term Label}",
}
}])

Expand Down
Loading

0 comments on commit 3f83b07

Please sign in to comment.