3

I want to add list, site column, content type etc to a SharePoint framework app using may be yeoman generator or anything else, i know it might be achieved by API calls but i want to add like the way we can add list, columns, content types to SharePoint hosted app by Add->New Item->List etc. Actually i don't want to add the list on run time. Any help ????

2

You can provision SharePoint columns, content types and lists. These will get provisioned when you install a sppkg in a site. It also supports upgrading. I have implemented this practically. I can help you with any issues.

https://dev.office.com/sharepoint/docs/spfx/web-parts/get-started/provision-sp-assets-from-package

Please make sure the feature id in an Elements.xml file same as in the article if you are inheriting from custom list.

Additional Resources

https://www.youtube.com/watch?v=r-UdJhhHlEQ&list=PLR9nK3mnD-OUnJytlXlO84fQnYt50iTmS

  • Hi Venkat, can u assist me in this sharepoint.stackexchange.com/questions/213783/…, any tutorial or code sample , if u can share?? – Saad Zulfiqar Apr 25 '17 at 13:23
  • I have followed the tutorial in my answer. But I am happy to share my sample through the email. – Venkat Konjeti Apr 25 '17 at 13:26
  • I have followed the tutorial in your answer as well, the issue is coming in the upgrading step, if you can see my question in the already given link, i have successfully created list in upgrading phase, the issue is in when i am trying to add new column in the content type, if you can send me code sample, it will be highly appreciable. My email is szulfiqar@xavor.com – Saad Zulfiqar Apr 25 '17 at 13:33
  • I have not done the upgrade process meanwhile you can follow this link to see how to add a new field in upgrade process. dev.office.com/sharepoint/docs/spfx/toolchain/…. I will the POC and share. – Venkat Konjeti Apr 25 '17 at 13:39
  • I must be the daftest thing, but where in that article does it talk about generating the IDs for the fields? I've seem people write articles that seem to have these fields prepopulated without talking about how to come up with them (presumably pre-generated as unique GUIDs)... – Wonderboy Dec 7 '18 at 4:04
2

This is covered in the SharePoint Framework documentation with the "obvious" title Provisioning SharePoint assets from your SharePoint client-side web part

0

Creating lists, site columns and content types aren't supported (yet). The SharePoint Framework currently only supports web parts.

Read more here: https://dev.office.com/sharepoint/docs/spfx/sharepoint-framework-overview

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.