title: Dropdown list with conditions on other dropdown list
body: <p>How can I make a drop-down list from several lists with a condition from another drop-down list?</p>
  
  <p>Using my image above, let's say I on the first drop-down list (this one is a simple one) select "Furniture"... I would like the second drop-down list to only show the furniture. Same thing with the third drop-down list, would like only the color of my second choice to be shown there.</p>
  
  <p>Did try to place on the criteria "Custom formula" in the "Data validation" one of this two formulas but does not work...</p>
  
  <pre><code>=FILTER(Object,Type = E2) 
  </code></pre>
  
  <p>or </p>
  
  <pre><code>=QUERY(A:C,"SELECT B WHERE A='"&amp;E2&amp;"' ", 0)
  </code></pre>
  
  <p>Did read in some other topic here that it was not possible with formulas and I could not find an app script for it. How can i place conditional rules and make only appear the values i want on the drop-down menu instead all of them ? I think it has something to do with the "withCriteria(criteria, args)" however i am not understanding how to apply it.</p>
  
  <p>About the list ... it will be compose maybe with 2k lines (each line 3 columns). First column will only have (maybe) 6 or 7 different values. Second about 70 or 80 and third all different. The order will be random cause new values could be added and i can be adding a new Furniture or Animal ... </p>
  
  <p>This is the code i have now</p>
  
  <pre><code>function onEdit(e) {
    var range = e.range;
    var ss = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Sheet1');
    if ( range.getRow() &gt; 1) {
      if ( range.getColumn() == 5) {
        var cell_Range = ss.getRange( range.getRow(), range.getColumn() + 1);
        var cell = cell_Range.getCell( 1, 1);
        var rangeV = SpreadsheetApp.getActive().getRange('B2:B13');
        var rule = SpreadsheetApp.newDataValidation().requireValueInRange(rangeV).build();
        cell.setDataValidation(rule);
      }
      else if ( range.getColumn() == 6 ) { 
        var cell_Range = ss.getRange( range.getRow(), range.getColumn() + 1);
        var cell = cell_Range.getCell( 1, 1);
        var rangeV = SpreadsheetApp.getActive().getRange('C2:C13');
        var rule = SpreadsheetApp.newDataValidation().requireValueInRange(rangeV).build();
        cell.setDataValidation(rule);
  
      }
    }
  }
  </code></pre>
  
  <p>Example sheet at <a href="https://docs.google.com/spreadsheets/d/1aLpYd8fC0jpwvQOPVTj_yvY7DVKeFFnPvpJSF27if6w/edit?usp=sharing" rel="nofollow noreferrer">https://docs.google.com/spreadsheets/d/1aLpYd8fC0jpwvQOPVTj_yvY7DVKeFFnPvpJSF27if6w/edit?usp=sharing</a></p>
  
  <p>Thanks in advance</p>