plugins.dialogs.showSelectDialog question

Is it possible to dynamically set the values that are shown? I have played with arrays, tried to set values comma seperated in a loop but I don’t get it to work. Any ideas?

var maxReturedRows = 3;
var query = ‘select company_name from companies’;
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, maxReturedRows);
var array = dataset.getColumnAsArray(1);//put 1st column in array
// (or like this) var array = new Array(‘one’,‘two’,‘three’);
plugins.dialogs.showSelectDialog(‘Select’,‘please select a name’,array);