I have a sheet which tracks pupil progress against a set of objectives - pupil name across the top, objectives listed down the left hand side. Each pupil is in a group - in the example below the groups are indicated by SK, IO and NU.
I have created a sidebar with various filters.
The issue I am having is with the filter where the user will enter a group name, when the filter button is clicked all of the columns will hide except for the columns which contain the entered group name. I have the following code:
from the .gs sheet:
function showGroup(group) {
for(var i=2; i<lastCol-36; i++) {
if(data.getCell(8, i).getValue() != group) {
sheet.hideColumns(i);
}
}
}
from the html sheet:
<form id="filterGroups" >
<input type="text" value="" id="groupName">
<input type="button" value="Filter"
onclick="google.script.run.showGroup(filterGroups)" />
The closest I have got to success is to hide all columns providing the form id matches the parameter passed to google.script.run.

