I am not able to read the JSON data which is coming from server and I would like to store one value into local variable? It is working fine if I bind the same model to UI controller ,the data is displaying correctly.But I need store one value into local variable.
Here is my code:
var oModelData = new sap.ui.model.json.JSONModel();
var root = window.location.protocol + '//' + window.location.host;
var url = root + "/idmrest/v72alpha/entries/0";
var zkey = this.getView().getModel("model1").getProperty("/ENTRIES/MSKEYVALUE/VALUE");
and It is saying "undefined" and if I use:
var zkey = oModelData.getProperty("/ENTRIES/MSKEYVALUE/VALUE");
here also it is undefined
can any body please suggest me here? and also how do we get the array and loop it which is inside the JSON (model1)?