Using SharePoint Framework extension, I have a list command set for a document library in SharePoint online.

On this button being clicked, I want to add an item in a predefined list in sharepoint online with server relative url of the selected document in the library.

So precisely, I am trying to add an item in the list using a list command set for which the page url is a library.

Can it be done? Can I actually add an item in list (one of JSOM operations?) via listview command set framework extension?

PS: I am new to Sharepoint so still trying to get familiar with its features and utilities.


Eventually I was able to do it by using PnPJS for Sharepoint online Javascript library.

Create a regular SPFx solution for list view command set. Add packages for sp-pnp-js.

Refer: https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/guidance/use-sp-pnp-js-with-spfx-web-parts

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.