0
votes

What I'm trying to do is basically just getting the value of a cell to filter switch cases but I always get the default result.

{
var ss = SpreadsheetApp.getActiveSpreadsheet();
var bl_sheet = ss.getSheetByName("Bold Listing");

var bl_quantity = "";
bl_quantity = bl_sheet.getRange('C4');

switch (bl_quantity) {

  case "None":
    bl_sheet.hideRows(5,10);
    bl_sheet.getRange('C5:C14').setValue("");
    break;
  case 1:
    bl_sheet.showRows(5,1);
    bl_sheet.hideRows(6,9);
    bl_sheet.getRange('C6:C14').setValue("");
    break;
  default:
   bl_sheet.getRange('C15').setValue("default");
}
1

1 Answers

1
votes

I realized I forgot to add getValue on the switch expression

switch (bl_quantity.getValue())