Skip to Content

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

How to save the values of a ComboBox in an array?

Hello Experts,

I am trying to fetch the values of a list and save them in a variable (array variable). For example, in the following bin:

JS Bin - Collaborative JavaScript Debugging

The expected result would be a variable

oColors = ['Blue' , 'Brown' ,'Green' , 'Black']

By Debbugging I could see the values of the binding variable, but I could not come up with the way of saving them in an array.  Thank you in advance,



oColors = $.map(this.byId("Farbe").getItems(), function (item, i) { return item.getKey(); } )


$.map(this.byId("Farbe").getItems(), function (item, i) { return item.getText(); } )

1 View this answer in context

Helpful Answer

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