I have several custom bits of information that I would like to store at the web-level, similar to how project-level properties are stored and accessed, like logo, title, etc on the _layouts/15/prjsetng.aspx page.

I could add these properties to a 1-row custom list, but this seems like a bad practice.

Some details on my implementation:

  • SharePoint-hosted app in SharePoint Online
  • Can use JSOM if necessary
  • No code-behind (No-Code Sandbox Solution)

Is this possible?

2 Answers 2


You can use Sharepoint site property bag to store web level properties like:

function tag() {
    var hostweburl = decodeURIComponent(getQueryStringParameter("SPHostUrl"));
    var appweburl = decodeURIComponent(getQueryStringParameter("SPAppWebUrl"));

    var clientContext = new SP.ClientContext.get_current();
    var hostContext = new SP.AppContextSite(clientContext, hostweburl);

    var web = hostContext.get_web();

    var webProperties = web.get_allProperties();

    webProperties.set_item("DirectoryTagged", true);

    clientContext.executeQueryAsync(TaggedSuccess, TaggedFail);

function TaggedSuccess(sender, args) {
    $("#results").text("Tagged your site.");

function TaggedFail(sender, args) {
    $("#results").text("Tagging failed");


Saving data in Host web list is also a good idea. You can easily make changes to that data.For detailed implementation check:


  • Thank you for describing both options. Based on this and PirateEric's recommend I'll likely go list. Sep 25, 2014 at 19:03

Why would it be bad practice? It makes config changes much easier than having to redeploy code to fix. So long as everyone has read access and the appropriate people have contribute/full control, it works well. I do it for a variety of applications and workflows.

  • I guess maybe "bad practice" is a bit strong. Adding an entire list just to service 3 - 4 bits of data seems like overkill. Just wondering if there was a better/cleaner option. Of course my research isn't turning up many alternatives, so perhaps the list approach is the acceptable alternative. Sep 25, 2014 at 16:58
  • 1
    I guess it depends on what the data is. I store things like email addresses that can be volatile in lists like this, that way the site admins have control over the information easily and I don't need to deploy code to resolve their config/admin changes. Sep 25, 2014 at 17:23
  • Excellent point regarding volatility. Sep 25, 2014 at 19:01

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.