Skip to Content
avatar image
Former Member

How to loop through each record of Odata service dataset in SAPUI5

I have an Odata service with one dataset. I want to fetch all record and loop through each row which contains 5 column, to form a customized string in SAPUI5.

How can i fetch each row in a loop from model. Kindly help.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jul 12, 2017 at 09:36 AM

    Get var yourData = oData.getData() -> list of objects or rows of data.

    For loop through the yourData array and get each row.

    You can also use .forEach() function and then operate on each row/object in the variable.

    Regards,

    Sharath

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 13, 2017 at 12:54 PM

    take data from model (oModel.getData()), and do for loop, or use $.map(oData, function(obj, index) { })

    any issue you are getting ?

    Add comment
    10|10000 characters needed characters exceeded