Bir gıda kaydedici hazırladım. Ve [1] Sayfasında bir satır ekleyebilmem ve yeni bir yiyecek kaynağı eklemem için bana zaten izin verilmemesini sağlayan bir komut dosyası oluşturmaya çalışıyorum. Bu kod burada çalışır, ancak yürütmek için çok yavaştır. Her soru arasında yaklaşık bir saniye var. İdamları daha hızlı hale getirmek için herhangi bir olasılık var mı, yoksa tek bir Sorgudaki 4 değeri isteyin mi?Çok yavaş UserInput Google Scripts
// Display a dialog box with a title, message, input field, and "Yes" and "No" buttons. The
// user can also close the dialog by clicking the close button in its title bar.
function foodSource(){
var ui = SpreadsheetApp.getUi();
var response = ui.prompt('Tilføjelse af madvare', 'Hvilken madvare er det?', ui.ButtonSet.OK);
return response.getResponseText();
}
function protein(){
var ui = SpreadsheetApp.getUi();
var response = ui.prompt('Mængde pr 100 gram', 'Protein', ui.ButtonSet.OK);
return response.getResponseText();
}
function carbonhydrates(){
var ui = SpreadsheetApp.getUi();
var response = ui.prompt('Mængde pr 100 gram', 'Kulhydrater', ui.ButtonSet.OK);
return response.getResponseText();
}
function fat(){
var ui = SpreadsheetApp.getUi();
var response = ui.prompt('Mængde pr 100 gram', 'Fedt', ui.ButtonSet.OK);
return response.getResponseText();
}
function addData(){
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[1];
sheet.appendRow([madvare(),100, protein(), carbonhydrates(), fat()]);
}