Skip to Content
0

Json structure

Nov 09, 2016 at 04:13 PM

88

avatar image

I am programming in sapui5 (Eclipse neon) and would like to know how I could iterate over a Json structure.

The source data for the chart are in a Json File. In my case, I should first group the desired information and add them. Then I could insert them into the chart. How can I do this? How do I handle (create and manipulate) a json object in sapui5?

Attached I send the json file.

I hope you can help me.
Best regards,
Anna Oliveira
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

madhu sudhan Nov 10, 2016 at 05:19 AM
0

hi,

check this file

data.txt


data.txt (2.4 kB)
Share
10 |10000 characters needed characters left characters exceeded
Vijay Kumar Kalluri Nov 10, 2016 at 01:30 PM
0

As per attached JSON Model have missing ] }(ending).

Iteration code like

var acountsJson = sap.ui.getCore().getModel("acountsModel").getProperty("/");for(var i =0; i < acountsJson.length; i++){var obj = acountsJson[i];

    console.log(acountsJson[i].id);}

Better to check this Sap UI5 with Local JSON Model

Share
10 |10000 characters needed characters left characters exceeded
Manish Choudhary
Nov 11, 2016 at 02:57 PM
0

There are couple of websites available to check the JSON format like :- https://jsonformatter.curiousconcept.com/ .

These are helpful to understand where is error.

Share
10 |10000 characters needed characters left characters exceeded