Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to Fetch data present in the JSON File and display it in the List form


    I want to fetch the data present in the json file and display it in the list form in the view.Please help me with this.

The json file(choice.json)  i am using have the following data:





            "FirstName": "Jack",

            "LastName": "Son"



            "FirstName": "John",

            "LastName": "Mathew"



            "FirstName": "Brett",

            "LastName": "Lee"




and my project structure looks like this

Thanks and Regards,


Former Member
Former Member replied

Hi Lahari,

It looks like you are using a factory function for custom list aggregation. You can try something like this,

Controller onInit function:

onInit: function() {

  var oModel = new sap.ui.model.json.JSONModel();


  this.getView().setModel(oModel, "choice");


View createContent function:

createContent : function(oController) {

  var oList = new sap.m.List("listid", {

    mode: sap.m.ListMode.SingleSelectMaster





    function(sId,oContext) {

      return new sap.m.StandardListItem({

        title: oContext.getProperty("FirstName") ,

        description:"ui5 is great"





  return oList;




0 View this answer in context

Helpful Answer

Not what you were looking for? View more on this topic or Ask a question