2

I'm new to building apps for SharePoint in Office 365. I'm pretty new as a developer as well. I do know that Apps are now called Add-ins, but I'm using Visual Studio and the projects are still named with the old SharePoint Apps.

I'd like to create a SharePoint hosted app that gives me an interface to create a list (that I've defined) and choose which site collection / sub site to create it on. I don't want it on the app web.

I followed this tutorial and it kind of does what I'm looking for, but it creates the list on the app web.

https://msdn.microsoft.com/library/office/jj220041(v=office.15)

I'd rather be able to create the list from the "Add an app" option under settings.

Currently, I can create a new SP app project. I see where I can create content types, columns, etc. However, I'm not sure where to go from there.

If this is possible for an SP hosted app, I'd prefer to use JavaScript, HTML, CSS.

Can somebody help guide me in the right direction?

1 Answer 1

1

try this:

  var executor = new SP.RequestExecutor(appwebUrl);

                executor.executeAsync({
                    url: appwebUrl + "/_api/SP.AppContextSite(@target)/web/Lists?@target='" + the_site_location + "'",
                    method: "POST",
                    body: "{ '__metadata': { 'type': 'SP.List' }, 'BaseTemplate': 100,'Description': '" + description_here + "', 'Title':'" + title_here + "'}",
                    headers: {
                        "content-type": "application/json; odata=verbose"
                    }, success: function (data) { console.log('Success creating custom lists');},
                    error: function (err) { conosole.log('Failed for creating custom list !'+ err);}

                })

beep me if some problem occur.!

2
  • Thanks. I'm not to the point where I'm using JavaScript yet. I'm making my way through the tutorial just to get the basics down. I'll post back later..
    – spex5
    Commented Oct 22, 2015 at 21:47
  • I'm struggling to find some good resources to learn how to use JavaScript to create SP apps at a beginner level. Do basic things like creating lists, adding functionality using JSOM. The technet articles move a little fast. Is there a good resource outside of technet to learn how to build SP apps / add-ins? I'm experienced with SharePoint and on-prem server side stuff and have a beginner level knowledge of JavaScript to give you an idea of my current skill level.
    – spex5
    Commented Oct 24, 2015 at 18:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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