cancel
Showing results for 
Search instead for 
Did you mean: 

Json structure

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (3)

Answers (3)

0 Kudos

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

These are helpful to understand where is error.

vijay_kumar49
Active Contributor
0 Kudos

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

former_member257196
Participant
0 Kudos

hi,

check this file

data.txt