Pnpjs: await list.items.getById(id).update

Created on 7 Aug 2020  路  2Comments  路  Source: pnp/pnpjs

Category

  • [ ] Enhancement
  • [X] Bug
  • [X] Question
  • [ ] Documentation gap/issue

Version

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

Please specify what version(s) of SharePoint you are targeting: [ Online ]

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

let list = sp.web.lists.getByTitle(this.props.list.toString()); const i = await list.items.getById(id).update({ KmCa: "OT", }); console.log(i);

Observed Behavior

Only works in my Workbench.aspx

Steps to Reproduce

  1. Update a field in /Site/_layouts/workbench.aspx
  2. Bundle
  3. Package-solution
  4. Put in Tenant

I'm Getting the list by Guid
Field name is OK, not misspelled

Uncaught (in promise) Error: Error making HttpClient request in queryable [404] ::>

answered not a bug question

All 2 comments

Hi Andrew,

Thank you, using now:

sp.setup({ spfxContext: this.props.context });

Was this page helpful?
0 / 5 - 0 ratings