How to get checked rows' values from html table on a sidebar using GAS?

Solution 1:

Sample of how to get the checked tickboxes an button click

  • Assuming all your checkboxes are tied to a row, you can loop through all checkboxes with a query selector,
  • access their checked status
  • and save the indices of those checkboxes.
  • Those indices will be the same as when looping through the corresponding table rows.

Sample implementing a button click event:

var saveButton = document.getElementById("myButtonId"); 
saveButton.onclick = function(){
  var checkedRowIndices = []; 
  $('input[type=checkbox]').each(function( index ) {
    if($(this)[0].checked{
      checkedRowIndices.push(index);
    }
  }); 
};
//now get the rows with those indeices and do something with them