title: Data Validation should be pulling based off of previous Options. Returning Undefined
body: <p>The Bid Sheet is ultimately supposed to enable the user to enter the various Options and it will give them a list if Items with those Options. I suspect my attempt to use the same scripting as the single validation Option is insufficient to handle the multiple Options, but I am too inexperienced to know a better path.</p>
  
  <p>Everything works except for this piece. Which returns "undefined".</p>
  
  <pre><code>      var cell = ws.getRange(r,OptionDesc);
        var FullOptions = ws.getRange(r, 2, 1, 7).getValues();
        var listToApplyDesc = FullOptions.map(function (o) { return o[7] });
        applyValidationtoCell(listToApplyDesc,cell);
  </code></pre>
  
  <p>I've included the full script and a link to a copy of the Sheet since I'm not confident enough to simplify to the "minimum reproducible example".</p>
  
  <p><a href="https://drive.google.com/open?id=1Y0VT3KYD1wbj6QR1gTLepn7KtxU91rQoqRLL2Zg9-FI" rel="nofollow noreferrer">https://drive.google.com/open?id=1Y0VT3KYD1wbj6QR1gTLepn7KtxU91rQoqRLL2Zg9-FI</a></p>
  
  <pre><code>var mainWsName = "Bid Sheet";
  var nameData = "Data";
  var Category = 2;
  var ManualAutomatic = 3;
  var OptionA = 4;
  var OptionB = 5;
  var OptionC = 6;
  var OptionD = 7;
  var OptionE = 8;
  var OptionDesc = 9;
  
  
  var ws = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(mainWsName);
  var wsData = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(nameData);
  var manAutoOption = wsData.getRange(2, 1,wsData.getLastRow()-1,9).getValues();
  //Must change getLastRow Column count to include any added Options
  
  function onEdit(e){
    var activeCell = e.range;
    var val = activeCell.getValue();
    var r = activeCell.getRow();
    var c = activeCell.getColumn();
    var designator = ws.getRange(r, 1);
    var designatorValue = designator.getValue();
    if (designatorValue != "x") return;//designator IF only allows the script to run on rows with x.
    var wsName = activeCell.getSheet().getName();
    if (wsName === mainWsName &amp;&amp; c === Category &amp;&amp; r &gt; 10){
      OptionsValidation (val,r);
  
    }
  
  
  }//end onEdit
  
  //OptionsValidation required to clear Option cells on Category change
  function OptionsValidation (val,r){
       if(val === ""){ 
        ws.getRange(r,ManualAutomatic, 1, 7).clearContent();
        ws.getRange(r,ManualAutomatic, 1, 7).clearDataValidations();
      } else {
        ws.getRange(r,ManualAutomatic, 1, 7).clearContent();
  
  
  //Sets a Data Validation Dropdown based off of input from Category
        var filterOptions = manAutoOption.filter(function(o){ return o[0] === val });
        var firstLevelColValue = ws.getRange(r, Category).getValue();
        var filterOptions = manAutoOption.filter(function(o){ return o[0] === firstLevelColValue});
        var listToApplyMA = filterOptions.map(function (o) { return o[1] });
        var cell = ws.getRange(r,ManualAutomatic);
        applyValidationtoCell(listToApplyMA,cell);
        var listToApplyA = filterOptions.map(function (o) { return o[2] });
        var cell = ws.getRange(r,OptionA);
        applyValidationtoCell(listToApplyA,cell);
        var listToApplyB = filterOptions.map(function (o) { return o[3] });
        var cell = ws.getRange(r,OptionB);
        applyValidationtoCell(listToApplyB,cell);
        var listToApplyC = filterOptions.map(function (o) { return o[4] });
        var cell = ws.getRange(r,OptionC);
        applyValidationtoCell(listToApplyC,cell);
        var listToApplyD = filterOptions.map(function (o) { return o[5] });
        var cell = ws.getRange(r,OptionD);
        applyValidationtoCell(listToApplyD,cell);
        var listToApplyE = filterOptions.map(function (o) { return o[6] });
        var cell = ws.getRange(r,OptionE);
        applyValidationtoCell(listToApplyE,cell);
        var cell = ws.getRange(r,OptionDesc);
        var FullOptions = ws.getRange(r, 2, 1, 7).getValues();
        var listToApplyDesc = FullOptions.map(function (o) { return o[7] });
        applyValidationtoCell(listToApplyDesc,cell);
  
  
      }
  }
  
  function applyValidationtoCell(list,cell){
    var rule = SpreadsheetApp
    .newDataValidation()
    .requireValueInList(list)
    .setAllowInvalid(false)
    .build();
  
  
  cell.setDataValidation(rule);
  
  }
  </code></pre>