Pergunta

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.

Foi útil?

Solução

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a sharepoint.stackexchange
scroll top