title: SAPUI5 get single property from JSON-Model
body: <p>I am currently trying to figure out how I can retrieve a single value from a  sap.ui.model.json.JSONModel </p>
  
  <p>in my main view:</p>
  
  <pre><code>var gConfigModel = new sap.ui.model.json.JSONModel();
  
  var getConfigCallback = function(config) {
      gConfigModel.setData(config);
  };
  
  oController.getConfiguration(getConfigCallback);
  console.log(gConfigModel);
  </code></pre>
  
  <p>in my controller:</p>
  
  <pre><code>getConfiguration : function(callback) {
  
      var sServiceUrl = "/sap/opu/odata/sap/xxx/ConfigurationSet('Initialize')";
  
      var config = {};
      callback(config);
  
      $.getJSON(sServiceUrl).done(function(data) {
          config = data.d;
          callback(config);
      });
  },
  </code></pre>
  
  <p>In my console.log statement I can see that the data was successfully passed from the backend and successfully set to the JSON model. My requirement is to store the value of attribute Editable in a single variable.</p>
  
  <p><img src="https://i.stack.imgur.com/djNFg.png" alt="console.log-statement"></p>
  
  <p>I already tried gConfigModel.getProperty('/'), didnt work. tried to access gConfigModel.oData was undefined .. How can I store it in a single value?</p>
  
  <p><strong>Solution Comment:</strong> If you catch data from a backend, you have to take care how long it takes. data can be available later then expected, in my case I added 1s timeout, afterwards I can access the property easily</p>
  
  <pre><code> setTimeout(function() {
       console.log(gConfigModel.getProperty('/Editable'));
   }, 1000);
  </code></pre>