這是PARTIAL Google腳本文件。如何從文本字段獲取用戶輸入並將它們變爲Google腳本中的變量?
Code.gs
CriteriaColumn,選擇1,DESTINATION1,選擇2,DESTINATION2應該是無論在HTML文本字段中輸入的用戶。
if (colIndex == CriteriaColumn && rowIndex != 1) {
從活動行中的列CriteriaColumn中獲取值。
if (status == Choice1) {
目標工作表被命名爲無論Destination1是什麼。
var targetSheet = ss.getSheetByName(Destination1);
}
else if (status == Choice2) {
目標工作表是無論Destination2是什麼。
var targetSheet = ss.getSheetByName(Destination2);
}
這是HTML文件。無論輸入到文本字段中,都應該成爲Google腳本中的變量。
的Index.html
<!DOCTYPE html>
<html>
<head>
<base target="_top">
</head>
<body>
文本字段下面由用戶輸入。它們應該成爲Google腳本中的變量。
<p>What is the criteria column? Use a number, not a letter. ie. A=1....Z=26<input type="text" name="CriteriaColumn"/></p>
<p>Choice 1<input type="text" name="Choice1"/></p>
<p>Choice 2<input type="text" name="Choice2"/></p>
<p>Destination 1<input type="text" name="Destination1"/></p>
<p>Destination 2<input type="text" name="Destination2"/></p>
單擊保存將保存其設置並將它們應用於Google腳本中的相應變量。
<p><input type="button" value="Save" onclick="google.script.host.close()" /></p>
</body>
</html>
感謝您的回覆。我如何在我的gs文件中將Choice1,Choice2等分配爲變量? – FlappyBird