107
rated 0 times
[
110]
[
3]
/ answers: 1 / hits: 30439
/ 11 Years ago, thu, march 28, 2013, 12:00:00
Looking for a little help I'm almost there but I know I'm just missing one thing and I have been searching for the answer for awhile.
I have a spread sheet with 1 column that has the first name and the 2nd has the last name, I'm trying to join them and display in full name in the listbox. Right now it populates with the values horizontally letter by letter, with the first columns values and then the second column values. Any help would be appreciated!
function studentBox(e) {
var app = UiApp.getActiveApplication();
var dateSelect = e.parameter.dateList;
var ss = SpreadsheetApp.openById('spreadsheetID');
var sheet = ss.getSheetByName(dateSelect);
var studentList = app.createListBox().setName('studentList').setId('studentList');
var cellList = sheet.getLastRow();
var fName = sheet.getRange(1,1,cellList,1).getValues();
var lName = sheet.getRange(1,2,cellList,1).getValues();
var fullName = (fName+ +lName);
//Add items to the list box
for(var i=0; i<fullName.length; i++){
studentList.addItem(fullName[i]);
}
app.getElementById('grid1').setWidget(1,1,studentList);
return app;
}
More From » google-apps-script