SharePoint/PnP-JS-Core

Trying to update sharepoint library metadata column using pnp js

Closed this issue · 1 comments

Thank you for reporting an issue, suggesting an enhancement, or asking a question. We appreciate your feedback - to help the team understand your needs please complete the below template to ensure we have the details to help. Thanks!

Please check out the Developer Guide to see if your question is already addressed there. This will help us ensure our documentation covers the most frequent questions.

Category

[ ] Enhancement

[ ] Bug

[ ] Question

Version

Please specify what version of the library you are using: [ ]

If you are not using the latest release, please update and see if the issue is resolved before submitting an issue.

Expected / Desired Behavior / Question

If you are reporting an issue please describe the expected behavior. If you are suggesting an enhancement please
describe thoroughly the enhancement, how it can be achieved, and expected benefit. If you are asking a question, ask away!

Observed Behavior

pnp.sp.web.lists.getByTitle("ListName").items.getById(1).update({
Title: Title,
DeptDiv://internal name of list column
{
__metadata:
{
"type": "SP.Taxonomy.TaxonomyFieldValue" },
Label: Department1,//value to be updated
TermGuid: "**********************",
WssId: -1,
}
}).then(r => {

console.log(r);

});

Steps to Reproduce

If you are reporting an issue please describe the steps to reproduce the bug in sufficient detail to allow testing. If you are making
a suggestion or asking a question delete this section.

Submission Guidelines

Delete this section after reading

  • All suggestions, questions, and issues are welcome, please let us know what's on your mind.
  • If you have a general question gitter may be a better forum.
  • Remember to include sufficient details and context.
  • If you have multiple suggestions, questions, or bugs please submit them in separate issues so we can track resolution.

Thanks!

Hi @vaishali-udupa - are you getting an error or what is the outcome? You haven't really provided enough for us to have a look at this. Thanks!


Thank you for your interest in the sp-pnp-js library. We wanted to mention that this library is being deprecated in July, 2018 in favor of the new scoped pnpjs libraries. You should begin transitioning your existing projects when possible, or start new projects with the new libraries. Please see the transition guide for more details on migrating and be sure to let us know if you have any questions. Thanks!