I want to use this script to retrieve multiple pieces of information from the spreadsheet. My goal is to have it look, but skip the cell it already retrieved its information from:
function doGet() {
var app = UiApp.createApplication().setTitle('When Am I Eligible?');
var panel = app.createVerticalPanel().setHeight("400px;").setWidth("800px");
//var submitButton = app.createButton('Check');
var key= '-----'
var ss = SpreadsheetApp.openById(key);
var sh = ss.getSheetByName('SHEET');
var last=ss.getLastRow();
var data=sh.getRange(1,1,last,5).getValues();
var valB= Session.getEffectiveUser();
var nn = 0;
for (cnt=0; cnt<8; ++cnt){
var nn = (nn+1)
for(var nn;nn<data.length;++nn){
if (data[nn][1]==valB){
var final = data[nn][0];
var final1 = data[nn][1];
var final2 = data[nn][2];
var final3 = data[nn][3];
var final4 = data[nn][4];
break} ;// if a match in column B is found, break the loop
}
var app = UiApp.getActiveApplication();
var answer = app.createLabel("BRO").setVisible(true).setText(final)
var answer1 = app.createLabel("BRO").setVisible(true).setText(final1)
var answer2 = app.createLabel("BRO").setVisible(true).setText(final2)
var answer3 = app.createLabel("BRO").setVisible(true).setText(final3)
var answer4 = app.createLabel("BRO").setVisible(true).setText(final4)
panel.add(answer).add(answer1).add(answer2).add(answer3).add(answer4);
app.add(panel);
if (cnt == 7) {
break}
}
return app;
}
Is there any way to do this, my counter is not working to save the place, i've tried ++nn
'making a new variable etc.