4

I want to create a SharePoint list programmatically from a SP addin.

I would like to know which approach is better:

  1. Using JavaScript or
  2. Using REST

Thanks In Advance

5

Definitely REST. SharePoint is moving more into the REST world with each update. It's how O365 is being geared. In fact MVP SympMarc (http://sympmarc.com/) who wrote SPServices (for javascript) now has a presentation on how to move from SPServices to REST services.

So definitely go with REST.

  • 1
    Why is it better than JS? This doesn't really answer the question. – Eric Alexander Dec 15 '15 at 13:20
  • You are correct, I guess it doesn't. However, when the industry is starting to move away from a technology why not support the technology that will be used more? He asked which is better. Right now, both approaches work just fine. You can create a list using each approach. But there is strong evidence that shows REST is now the tool to use, in my books that makes it the better approach. I think this can be quite subjective though. – David Drever Dec 15 '15 at 13:24
  • 1
    Marc is transitioning SPServices from SOAP to REST, it still uses jQuery/Javascript, so I'm not understanding what you are meaning with this. – Eric Alexander Dec 15 '15 at 13:30
4

I would use the JavaScript approach.

The CSOM/Javascript approach gives you much more coverage to the entire SharePoint API than REST. You still need to use Javascript to implement your REST request anyway.

http://www.slideshare.net/mrackley/sharepoint-rest-vs-csom

  • I like Eric's answer. When I was answering mine, I was thinking one of the other. Which means you would be either writing a Javascript app or another app that called REST services (like a CSOM Mananged code app). However, as Eric states, with Javascript you actually can have both. – David Drever Dec 15 '15 at 13:36
  • Thanks for your infos. I tried creating a custom list using REST and what I observed was that I get exactly a list that seems to be created manually using the custom list template and every user could do anything with the list(delete ,add , modify list items and settings etc). And when I delete my app the list remains undeleted! But when I created a custom list using JS the list was actually residing inside my app with almost no option to edit and was deleted when the app was uninstalled. In a scenario like this, would you recommend continuing with JS if the data is not important ? – samve Dec 16 '15 at 10:12

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.