Google Sheets - Dependent Dropdown List for Entire Column - App Scipt, Run On User Input - Part 1

Поділитися
Вставка
  • Опубліковано 9 лют 2025

КОМЕНТАРІ • 99

  • @ExcelGoogleSheets
    @ExcelGoogleSheets  7 років тому +8

    Correction: as mentioned in one of the comments it's also necessary to make sure the script runs only on the Main tab, so if statement needs to be modified to
    if(activeCell.getColumn() == 1 && activeCell.getRow() > 1 && ss.getName() == "Main"){

    • @ruiguerreiro4371
      @ruiguerreiro4371 6 років тому +4

      Hello there. Fantastic video. I was wondering how would I need to modify the script if I want it to work in specific sheets only. Is it possible? Thank you so much.

    • @brendanty1376
      @brendanty1376 3 роки тому

      i guess Im asking randomly but does someone know of a method to log back into an instagram account..?
      I was dumb lost the login password. I love any tips you can give me

    • @harlankingston841
      @harlankingston841 3 роки тому

      @Brendan Ty instablaster :)

    • @brendanty1376
      @brendanty1376 3 роки тому

      @Harlan Kingston Thanks for your reply. I got to the site through google and I'm waiting for the hacking stuff now.
      Seems to take a while so I will reply here later with my results.

    • @brendanty1376
      @brendanty1376 3 роки тому

      @Harlan Kingston It did the trick and I now got access to my account again. Im so happy!
      Thanks so much you really help me out !

  • @kyawnaingwin8300
    @kyawnaingwin8300 5 років тому +1

    This is what I have been looking for. Thanks Millions. Now I could create two level dependent drop down.

  • @jdemick
    @jdemick 4 роки тому +1

    Great video. Just a newbie trying to learn here. I couldn't help but laugh at the name you gave the data sheet var. Keep up the good work!

  • @zamapon
    @zamapon 6 місяців тому +1

    Superb! You’ve saved the day

  • @rockydagalea2422
    @rockydagalea2422 7 років тому

    This is what i Need Thank you! I havent done any script before, I was surprise how easy it is with this video.

  • @stellarshores8565
    @stellarshores8565 5 років тому +9

    Anyone else just copying him exactly and subbing your own values. I have no idea what is going on but it seems to be working

  • @Bdangzki
    @Bdangzki 5 років тому +1

    Tremendous effort you put on here! Now my sheet is doing just that. Thank you so much! :D :D :D

  • @NgocTran-we1gw
    @NgocTran-we1gw 5 років тому +2

    this video made my day today. it's all i need. thank you

  • @dominikt5486
    @dominikt5486 4 роки тому +1

    Your videos are amazing. I've been using this script for a while, but I would like to be able to utilize it in more than one tab of a document. And also in more than one section of a tab at the same time.
    How would I go about doing this? Making copies of the script with the new tab names didn't work for me. Is it because the variables also have to have unique names?

  • @DemonsterousD
    @DemonsterousD 6 років тому +3

    Is there a way to have a third drop down row appear based on the value selected in the second drop down? I'm not familiar with AppScript. I just copied step by step what you did here in this video and it worked fine. However, I'm not sure how to duplicate it for a third drop down. Please help!

  • @lgupta2
    @lgupta2 4 роки тому +1

    Hi thanks for the great video with easy explanations. In my car the logger ins't reporting any values, just saying, "Waiting for logs, please wait..." what could be the problem for this?

    • @Dyl0829
      @Dyl0829 4 роки тому

      same and I can't figure it out, did you end up figuring it out

  • @slowly-but-eventually
    @slowly-but-eventually 2 роки тому

    function onEdit() isn't working for me. It triggers the moment I run the script.
    EDIT: Nevermind. It all works fine. Thanks a lot for this clear tutorial!

  • @chrisharris6265
    @chrisharris6265 4 роки тому

    This works great! I need to add a column to the left, this upsets the offsets, can anyone tell me which values in the script i need to change please?

  • @MostafaHosny1
    @MostafaHosny1 6 років тому

    What an effort!! Thanks a lot

  • @alexstojkovic856
    @alexstojkovic856 4 роки тому

    Fantastic tip - LOVE IT!!! I do have a question, however, when I try and replicate the main and subcategory to a let's say the two cells below, it doesn't work. boo! Any suggestions on how I copy the main category and its sub to the series of cells below? Thoughts? TY!

  • @onixmaiden592
    @onixmaiden592 5 років тому

    Hi, hi. Thanks for these info. Cought some tips, but not able to find what I was looking for, can you help? It si easy that I can't find a way to do it so if you can guide me to the correct direction.
    Basically, I need to make a dropdown for several rows -done-. On each row, from the selected item, need the next column to choose only one option from a list. I kind of knew how to do it on Office, but learning sheets. Can you tell me which tutorial to watch. Thanks.

  • @khanhphan-ci4lt
    @khanhphan-ci4lt 6 років тому

    That is so great. Thank you so much, i have seen all your clip - Will you do something more soon ?

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  6 років тому +1

      Just uploaded 5 more videos this week.

    • @khanhphan-ci4lt
      @khanhphan-ci4lt 6 років тому

      I am in VietNam, and every morning i get up to learn coding via your clip. It is so helpful in practise

  • @_Seamock
    @_Seamock 4 роки тому

    When I type "." on my scripts the functions/formulas were not showing up, I want to have something like on your video (timestamp 6:45), thanks a lot!!

  • @elisivlindroth852
    @elisivlindroth852 6 років тому +1

    Hi! I would like to combine dropdown lists with a gantt chart for my farmplanning. Exempel: In the dropdown lists I want to be able to choose a vegetable (broccoli) and in the second dropdown list I want to choose the variety (sprouting). Then I want to be able to see in a gantt chart when this type of broccoli will be in the ground. Do you have a tutorial on that? Or a link to a tutorial? Thanks!

  • @eugenekoiner
    @eugenekoiner 5 років тому

    great video! but can we make a cell to show an option by default instead of picking it everytime in every cell?

  • @chrislam9189
    @chrislam9189 7 років тому

    this video is excellent, I would like to know more about the AppSheet introduction video that was mentioned. Would you please provide some reference? Thanks!

  • @katietownsend8927
    @katietownsend8927 5 років тому

    Is there a way to do these dynamic drop downs if the two lists of data are in 2 columns instead of columns and rows? Ie. Column 1 is athlete names and columns 2 is athlete school. I want to be able to select the school on another sheet and be able to get a drop down of all the athletes assigned to that school

  • @Avi8053
    @Avi8053 4 роки тому +1

    This is awesome! Could you please share the sheet with us, so that we could save as a copy, please?

  • @pichit.raetai
    @pichit.raetai 4 роки тому

    thank you very much

  • @sebastianlamorgia314
    @sebastianlamorgia314 4 роки тому

    This is exactly what I need., I'm following the exact same steps but cannot make it to run. No error messages nor log events. Any clues?

  • @oleksandrruzhylo2193
    @oleksandrruzhylo2193 4 роки тому

    Could it work for multiple sheets and multiple columns on each? Thanks.

  • @mpkelum5206
    @mpkelum5206 4 роки тому

    Excellent Videos ...Please explain Why still google does not include easy function for Multi Dependent Drop Down list option...?( I mean unable to enter INDEX function in data validation in google sheet.) Do U have any idea..?Please explain..

  • @googes061
    @googes061 7 років тому

    AMAZING VIDEO!!!
    If the new Data Validation Range returns 0 or "" and there is not data for it to retrieve to populate the dependant dropdown: is there a way for the Validation to not appear? like a:
    if(validationRange = 0){
    activeCell.offset(0, 1).clearContent().clearDataValidations();
    }
    Not all of my options will require a dependant dropdown.
    Thank you.

  • @adudas78
    @adudas78 6 років тому

    Hi, great video. Is there a way to make the validation where on invalid data to Reject input?

    • @derekherzog1569
      @derekherzog1569 5 років тому

      I haven't watched the vid yet but I'm guessing he achieves data validation through apps script; if you do it instead through the "data" tab you will see an option for "reject invalid data"

  • @frostyzmp
    @frostyzmp 6 років тому

    Thank you very much !!

  • @beyobeya
    @beyobeya 4 роки тому

    Hi, can we do this in MS Excel (not in Google Sheet) without using a script or VB? I have a column that needs data validation and each item in that column has this formula: =INDIRECT(SUBSTITUTE($D$2," ","_")) and the next item has to be D3, then D4, D5,... Thanks in advance!

  • @itrauco
    @itrauco 6 років тому +21

    "var datAss = " in camel case

  • @michellerodel9749
    @michellerodel9749 3 роки тому

    It is possible to data validation from other worksheet?

  • @bernardjunebabierra8669
    @bernardjunebabierra8669 5 років тому

    HI. I have seen and tried the instructions but when I tried using it with 2 dependent drop down., one is working and the other is not. what seems to be the problem? please help me.
    Thank you

  • @giridharron6755
    @giridharron6755 6 років тому

    how do I pull historical stock prices from googlefinance in an array? does date needs separate data declaration?

  • @tomseemu
    @tomseemu 2 роки тому

    What is faster? Using dependent dropdowns using formulas? Or using AppScripts?

  • @berendotto
    @berendotto 4 роки тому

    This is so easy in Microsoft Excel... A shame Excel is not working on Android with a 2019 Office subscription...

  • @TheAgvBandit
    @TheAgvBandit 6 років тому

    Hi, i would like to make a drop down list where the value in the data validation can only be used once

  • @labestialceramica2674
    @labestialceramica2674 6 років тому

    Hello
    Im kind of new to script. But im kind of following your explanation. I have a question and i just cant find answer.
    I have a spreadsheet with multiple sheets. One is for production, another for sales. Both sheets, need dynamic drop dwon lists, but, columns are distributed different on each sheet.
    i just cannot make it to work at the same time, both dropdown list in differente columns on different sheets.
    Is there a way? thanks

  • @tadeulyrio5166
    @tadeulyrio5166 5 років тому

    In case the data in the first column is in date format. How do we work?

  • @fong9615
    @fong9615 5 років тому

    Hey can I do this in google web app also? so that when I want to make dropdown in webapp it will have dependent dropdown? Thanks!

  • @DenisVintage
    @DenisVintage 7 років тому +3

    Thanks for the video. By the way, I can't see any log. When I access the Log window it just says "No logs found. Use Logger API to add logs to your project."
    Any help?
    Thanks in advance!

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  7 років тому

      Logger.log shows just the latest run. If you want a log with history Google has console log API for this.

  • @sartajshaikh429
    @sartajshaikh429 6 років тому +1

    hi i like your video so much and its so useful. but i have small problem , i have to do entries in 3 columns and your video shows how to create dependent drop down list only referring to two columns so can u tell me how do such multi dependent google sheet

    • @gibranmagno
      @gibranmagno 6 років тому

      Hello! Did you find any answers?

    • @sartajshaikh429
      @sartajshaikh429 6 років тому +1

      yes. here is link of it

    • @sartajshaikh429
      @sartajshaikh429 6 років тому

      ua-cam.com/video/rW9T4XZy-7U/v-deo.htmlS.O.R.531721925318

    • @baynbogd4957
      @baynbogd4957 Рік тому

      @@sartajshaikh429 where your link is?

  • @CyframerEX
    @CyframerEX 7 років тому

    Thank you so much for this! This was super helpful! Also I love the variable "dat ass" ;)

  • @gerardomartinezr1183
    @gerardomartinezr1183 5 років тому

    Hi! what about if I already have an OnEdit function for another purpose? can I define an OnEdit2 or something like that? Thanks!

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  5 років тому

      no just add in the same onEdit function or create onEdit2 function and call it inside onEdit function, like onEdit2(e);

  • @Zaakbaatar
    @Zaakbaatar 6 років тому +1

    Unfortunately I have no Idea what i'm doing wrong here. It's not working. I've watched this video about 15 times.
    It is bringing out the drop down arrow on column 2 but it just keeps loading.
    What I'm trying to do is Dynamic Drop down list where When I select a product in column 7 of the Registry sheet then only the related sub categories will show up as data validation in column 8 of the Registry sheet. I have the info on the ProductINFO sheet.
    Can anyone correct my mistake. What am I missing here?
    Thank you in advance.
    function onEdit(){
    var ss = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
    var datass = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("ProductINFO");
    var activeCell = ss.getActiveCell();
    if(activeCell.getColumn() == 1 && activeCell.getRow() > 2 && ss.getName() == "Registry"){
    activeCell.offset(0 , 1).clearContents().clearDataValidations();
    }
    var makes = datass.getRange(1,1,1, datass.getLastColumn()).getValues();
    var makeIndex = makes[0].indexOf(activeCell.getValue()) + 1 ;
    if (makeIndex !== 0) {
    var validationRange = datass.getRange(3, makeIndex, datass.getLastRow());
    var validationRule = SpreadsheetApp.newDataValidation().requireValueInRange(validationRange).build();
    activeCell.offset(0, 1).setDataValidation(validationRule);
    }
    }

    • @azairvine
      @azairvine 6 років тому +2

      Mate, I know it's 6 months too late - but I just figured out what your problem is. I had the same issue and I sat here error trapping for HOURS before I found the solution. I have no idea why it's not triggering the same error in the original spreadsheet, though I think it's got something to do with the fact that our respective reference lists don't start in row 1. Anyway.
      This line:
      var validationRange = datass.getRange(3, makeIndex, datass.getLastRow());
      Needs to be:
      var validationRange = datass.getRange(3, makeIndex, datass.getLastRow() -2);
      What is happening is that it's setting the # of rows for validationRange to be the TOTAL # of rows of the sheet. When you START at row 3, it tries to extend down BEYOND the total length of the sheet and gets caught in an infinite loop. OMG it was such a pain in the ass to error-trap!

  • @oxpey4473
    @oxpey4473 2 роки тому

    How to make (WITH THIS EXAMPLE) three level dependents list on each other?

  • @4UBeatz
    @4UBeatz 6 років тому

    Im not sure what im doing wrong. Im trying to reference a particular cell based off 2 sets of data. I have a dropdown which inputs a range of data into a column and im trying to create a function based off the dropdown and range of data. Its a sports database so B1 is a particular team and A9 is their first opponent on the schedule. I want to create a function that gives their head to head record based off the table i created. I tried this but im just not getting anywhere =QUERY('Match-ups'!$A$2:$M14,"select * where A = '"&$B$1&"' AND 2 = 'A9'")

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  6 років тому

      this part is wrong 2 = 'A9'")
      2 should be the column letter and A9 should be concatenated. Like B = '" &A9&"'")

  • @prefeituradejoaopessoa1917
    @prefeituradejoaopessoa1917 6 років тому

    Is it possible to choose more than one value within the drop down? For example, the column is called team, and in each cell below I can open the drop down and choose a person or several who participated in a given project. It's possible?

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  6 років тому

      It's not going to work with a dropdown. It might be possible to do this with integrating webforms and make it work similar to that but it will be very complicated.

  • @sumitrodesalesmanager935
    @sumitrodesalesmanager935 4 роки тому

    Hi I tried executing the script, I'm able to see the changes in values on my sheet but when I check the logger it says " Waiting for logs, please wait..."

  • @halee2124
    @halee2124 5 років тому +1

    Can this work with a web app?

  • @emmettsempek
    @emmettsempek 4 роки тому

    Hi, could someone please tell me how to do this when the tab isn’t the first in the sheet. I’ve tried using the .getSheetByName() the sheer inky registers inputs from cells on the 1st sheet/tab. I need it to work for the 4th tab.

    • @rayzhu8368
      @rayzhu8368 4 роки тому

      YOU CAN REFER THE TOP COMMENT

    • @emmettsempek
      @emmettsempek 4 роки тому

      Ray Zhu For clarity, does that mean this script only works on the Main Tab? Thank you

  • @phoenixempire8886
    @phoenixempire8886 4 роки тому +1

    🙏🏻

  • @alexypolivany7148
    @alexypolivany7148 4 роки тому

    Spoiler alert- it is not the last video.

  • @jonalynfrias5458
    @jonalynfrias5458 4 роки тому

    Why am I getting this error ?? I just follow what you have written there.
    TypeError: SpreadsheetApp.getActiveSpreadSheet is not a function (line 3, file "Code")

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  4 роки тому +1

      It's probably getActiveSpreadsheet
      Everything is case sensitive.

  • @XMULTIBOX
    @XMULTIBOX 4 роки тому

    Could you plaaaaase put the code somewhere?

  • @dzilen
    @dzilen 4 роки тому

    There has to be a way to do this without using app scripts!

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  4 роки тому +1

      If you find how let me know :)

    • @JamieMACbid1
      @JamieMACbid1 4 роки тому

      ​@@ExcelGoogleSheets Me too? I wish GooglelSheets could just update he DataValidation function to handle formula references like Excel does!

  • @omsingh06
    @omsingh06 5 років тому

    Can we do without script?

  • @chanakankitrak9254
    @chanakankitrak9254 3 роки тому

    interest

  • @mdmazharulislam9564
    @mdmazharulislam9564 7 років тому

    Video Quality is very low

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  7 років тому

      It was just uploaded. UA-cam makes higher quality versions available a bit later. Try in 15 minutes.

    • @mdmazharulislam9564
      @mdmazharulislam9564 7 років тому

      Yes Done

  • @LP-ig8tg
    @LP-ig8tg Рік тому

    Main Tab: ColD & ColE for DDL | Lists Tab: ColJ:ColZ (21 columns) & Value Set G2:G16
    Fine until Time 1130, but onEdit fails to output 'Alert' on .setValues AND Log OK without [[Array | Arrays]]
    { var ColUIApps = ssdata.getRange(1,10,1,getLastColumn()) .getValues();
    Logger.log(ColUIApps);
    ss.getRange("Lists!G2:G16").setValue('Alert'); }
    Also used 'getActiveRangeList' and simple (1,10,1,21*) *instead of getLastColumn but failed the log and Array
    Pls verify the snippets

  • @1McAna
    @1McAna 4 роки тому +1

    Thank you so much!!!!