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 myFunction() { | |
const sheet = SpreadsheetApp.getActiveSheet(); | |
const data = sheet.getDataRange().getValues(); | |
const selectedRows = getIndexesOfSelectedRows(sheet); | |
for (let i = 0; i < data.length; i++) { | |
// skip not selected rows | |
if (!selectedRows.includes(i + 1)) continue; | |
const rowData = data[i]; | |
console.log(rowData); | |
// perform the relevant action: generate a document, send an email,... |