Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9628

Google Sheets Data Validation with List Dependencies

$
0
0

Is this even possible with Google Sheets? I've looked around and found some explanations on how to accomplish this by using scripts. However, the issue remains because I'm unable to have my script recognize my sheet. Something with not able to recognize "SpreadSheetApp" within my code.

I basically have a table I'm attempting to reference using a dependant dropdown or rather a data validation list.

Once the Sales Rep is chosen from the first Data Validation cell then that configures the states that are for that sales rep in another data validation cell adjacent.

Data Validation of sales rep, then attempting to have the "State" column show a list option for only the states for that sales rep.

Here is an image of my table for the sales reps which are on another sheet. Table of sales reps with their assigned states.

Any help would be very appreciated.

btw here's the script I can't seem to get to work at all.

function myFunction() { 
  var ws = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Data"); 
  var list = ["a","b","c"]; 

  var rule = SpreadsheetApp.newDataValidation().requireValueInList(list).build(); 
  ws.getRange("C2").setDataValidation(rule);
}

My script to build a the second data validation dropdown that would be dependant on the first(Sales Rep) column.


Viewing all articles
Browse latest Browse all 9628

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>