Closed mikezimm closed 5 months ago
I think you need to make a request for the page information.
// page is an instance of the page data object
const page = await sp.web.addClientsidePage("mypage1");
// info is the data for that page
const info = await page();
There are more examples of loading pages in the docs.
Closing this issue as answered. If you have additional questions or we did not answer your question, please open a new issue, ref this issue, and provide any additional details available. Thank you!
This issue is locked for inactivity or age. If you have a related issue please open a new issue and reference this one. Closed issues are not tracked.
What version of PnPjs library you are using
3.x
Minor Version Number
3.X
Target environment
SharePoint Framework
Additional environment details
Windows 10
Question/Request
Docs referenced: https://pnp.github.io/pnpjs/sp/clientside-pages/#create-using-iwebaddclientsidepage
I am successfully using this method to create a new clientside page: const page = await sp.web.addClientsidePage("mypage1");
However, I need to get the Id of the newly created page. I couldn't find any example other than one that said to use page.id but that does not work.
I'm guessing it's pretty easy, but I have not found a way to get it.
I've tried getting it by fetching the latest items right after it's done but if I am creating multiple ones sync mode, the latest Id isn't necessarily the correct one.
Thanks!