Someone know how to get value of a property bag with JSOM? I do this with C# code :

string anchorIdTheme = SPContext.Current.Web.GetWebProperty(WebProperties.NETWORK_THEME_NODE, string.Empty);

I want to do same thing with JSOM.


1 Answer 1


Use the following script to adapt to your needs. This gets all Web properties.

var webProperties;

function getWebProperties() {
    var clientContext = new SP.ClientContext.get_current();
    webProperties = clientContext.get_web().get_allProperties();
    clientContext.executeQueryAsync(Function.createDelegate(this, this.getWebPropertiesSucceeded), Function.createDelegate(this, this.onQueryFailed));

function getWebPropertiesSucceeded() {
    var allProps = webProperties.get_fieldValues();

    var customProp = "";

    if(webProperties.get_fieldValues().CustomSite_Version != undefined)
        var customProp = webProperties.get_fieldValues().CustomSite_Version;

function onQueryFailed(args, sender)
     //handle errors

If you want a specific property, use this:

  • Thanks, I tried it but I get "undefined" when I do : webProperties.get_fieldValues()["NetworkThemeNode"])
    Commented Sep 22, 2016 at 9:07
  • I mistyped the code and included an unnecessary parenthesis at the end. Make sure that is removed in your code. Commented Sep 22, 2016 at 9:10

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