I would like to delete terms not used in a TaxonomyField on any Item in a Document Library. I am new to CSOM and can't figure out how to proceed on this.

Can you help, please?

1 Answer 1

  1. Use the GetAllTerms method of the TermSet object to retrieve all terms.

  2. Use the GetItems method of the List object to retrieve all items. For each item, you can get the value of the TaxonomyField and keep track of the used terms.

  3. Any term that is in the list of all terms but not in the list of used terms is a term not used in any TaxonomyField.

  4. Use the DeleteObject method of the Term object to delete a term.

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.