The list is populated from the data in the “ Lists” sheet as mentioned before. The following script (function: createPrimaryDrpdwon) applies data validation to the range A2:A100 and creates a “region” dropdown list in each cell. Creating primary dropdown list in Google Sheets with Apps Script You can learn more about Class DataValidationBuilder from this Google Apps Script tutorial. However, unlike in the previous post, here I apply the data validation to relevant cells using Google Apps Script. In this method also, I am using data validation to create a dropdown list. You are also advised to do the same since I am going to use these names in the code. I have named the Sheet with the list of data for populating the dropdown as “ Lists” and the Sheet in which the dropdown menu created as “ Dropdown“. The primary dropdown is populated by “Region” and the Dependent dropdown list is populated by “Countries” where a Region has multiple countries.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |