Skip to Content
avatar image
Former Member

Json structure

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
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Nov 10, 2016 at 05:19 AM

    hi,

    check this file

    data.txt

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 10, 2016 at 01:30 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 11, 2016 at 02:57 PM

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

    These are helpful to understand where is error.

    Add comment
    10|10000 characters needed characters exceeded