我想使用这个脚本从电子表格中检索多条信息。我的目标是让它看起来,但跳过它已经从中检索到信息的单元格:
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;
}
有什么办法可以做到这一点,我的柜台无法保存这个地方,我试过++nn
'制作一个新变量等。