Created
June 22, 2018 12:52
-
-
Save oshliaer/ac39eb94d4392c8b5df9f9953f2a2759 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setDataValidation() { | |
// Ресурс | |
var resource = {}; | |
// Запрос | |
var request = {}; | |
// Для диапазона | |
var range = { | |
"sheetId": 0, | |
"startRowIndex": 0, | |
"endRowIndex": 1, | |
"startColumnIndex": 0, | |
"endColumnIndex": 1 | |
}; | |
// Правило | |
var rule = { | |
"condition": { | |
"type": "BOOLEAN" | |
}, | |
"strict": true | |
}; | |
// Действие | |
request.setDataValidation = { | |
range: range, | |
rule: rule | |
} | |
// Создать и заполнить очередь | |
resource.requests = []; | |
resource.requests.push(request); | |
// Выполнить пакетом очередь | |
Sheets.Spreadsheets | |
.batchUpdate(resource, SpreadsheetApp.getActive().getId()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment