How to set URL of workbench and get the list item by ID?

New Contributor

I am a newbie to SharePoint development. I am using PnP JS library to retrieve the list item for a specific ID. 


// get a specific item by id(LINK to open this)
const item: any = await sp.web.lists.getByTitle("My List").items.getById(1).get();

 My requirement is to get data for specific ID (Like- that ID should be work as a parameter.


so, the number in link 46 is List Item ID. How would I set that Param inside the spfx webpart?


Thank you!



0 Replies