with the help of a tutorial i made a script with dependent drop downs. I tried to modify it that when a cell in Column A is cleared/modified the first level of the drop down too.
var mainWsName = "master";var optionsWsName = "options";var ws = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(mainWsName);var wsOptions = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(optionsWsName);var options = wsOptions.getRange(2, 1,wsOptions.getLastRow()-1,2).getValues();function onEdit(e){ var activeCell = e.range; var val = activeCell.getValue(); var r = activeCell.getRow(); var c = activeCell.getColumn(); var wsName = activeCell.getSheet().getName(); if(wsName == mainWsName && c == 2 && r > 3){ if(val === ""){ ws.getRange(r, 3).clearContent(); ws.getRange(r, 3).clearDataValidations(); } else { ws.getRange(r, 3).clearContent(); var filteredOptions = options.filter(function(o){ return o[0] === val }); var listToApply = filteredOptions.map(function(o){ return o[1] }); var cell = ws.getRange(r, 3); applyValidationToCell(listToApply,cell); } } }function applyValidationToCell(list,cell){ var rule = SpreadsheetApp .newDataValidation() .requireValueInList(list) .setAllowInvalid(false) .build(); cell.setDataValidation(rule);}