SOLVED

PnP-JS-Core open web by url?

Copper Contributor

Every example I see of PnP-JS-Core uses the current web. How can I open a list from another web?

3 Replies
have not seen the code but i guess you need to create your own clientcontext with site url and then go to the correct web.

That's how you do it with CSOM, but PNP-Core is a wrapper for the REST services. Makes lots of things easier, but documentation is sketchy. Thanks for the response.

best response confirmed by Clifford Adams (Copper Contributor)
Solution

For anyone else searching for this. Here's how you do it:

var w = new $pnp.Web("/news");
w.lists.getByTitle("Alerts")....
1 best response

Accepted Solutions
best response confirmed by Clifford Adams (Copper Contributor)
Solution

For anyone else searching for this. Here's how you do it:

var w = new $pnp.Web("/news");
w.lists.getByTitle("Alerts")....

View solution in original post