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

Sdílet
Vložit
  • čas přidán 29. 08. 2024

Komentáře • 99

  • @ExcelGoogleSheets
    @ExcelGoogleSheets  Před 6 lety +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 Před 6 lety +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 Před 3 lety

      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 Před 3 lety

      @Brendan Ty instablaster :)

    • @brendanty1376
      @brendanty1376 Před 3 lety

      @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 Před 3 lety

      @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 Před 5 lety +1

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

  • @jdemick
    @jdemick Před 3 lety +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 Před 27 dny +1

    Superb! You’ve saved the day

  • @stellarshores8565
    @stellarshores8565 Před 5 lety +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

  • @rockydagalea2422
    @rockydagalea2422 Před 6 lety

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

  • @slowly-but-eventually

    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!

  • @NgocTran-we1gw
    @NgocTran-we1gw Před 5 lety +2

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

  • @Bdangzki
    @Bdangzki Před 5 lety +1

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

  • @itrauco
    @itrauco Před 6 lety +21

    "var datAss = " in camel case

  • @lgupta2
    @lgupta2 Před 4 lety +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 Před 4 lety

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

  • @DemonsterousD
    @DemonsterousD Před 6 lety +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!

  • @1McAna
    @1McAna Před 4 lety +1

    Thank you so much!!!!

  • @dominikt5486
    @dominikt5486 Před 3 lety +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?

  • @chrisharris6265
    @chrisharris6265 Před 4 lety

    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 Před 5 lety

    What an effort!! Thanks a lot

  • @alexstojkovic856
    @alexstojkovic856 Před 4 lety

    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!

  • @sebastianlamorgia314
    @sebastianlamorgia314 Před 4 lety

    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?

  • @onixmaiden592
    @onixmaiden592 Před 5 lety

    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.

  • @berendotto
    @berendotto Před 3 lety

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

  • @pichit.raetai
    @pichit.raetai Před 4 lety

    thank you very much

  • @elisivlindroth852
    @elisivlindroth852 Před 5 lety +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!

  • @frostyzmp
    @frostyzmp Před 5 lety

    Thank you very much !!

  • @eugenekoiner
    @eugenekoiner Před 4 lety

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

  • @LP-ig8tg
    @LP-ig8tg Před rokem

    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

  • @mpkelum5206
    @mpkelum5206 Před 4 lety

    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..

  • @dionigidialicarnasso23
    @dionigidialicarnasso23 Před 6 lety +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  Před 6 lety

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

  • @chrislam9189
    @chrislam9189 Před 6 lety

    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!

  • @tomseemu
    @tomseemu Před 2 lety

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

  • @Avi8053
    @Avi8053 Před 4 lety +1

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

  • @beyobeya
    @beyobeya Před 3 lety

    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!

  • @googes061
    @googes061 Před 6 lety

    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.

  • @oxpey4473
    @oxpey4473 Před 2 lety

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

  • @khanhphan-ci4lt
    @khanhphan-ci4lt Před 6 lety

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

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  Před 6 lety +1

      Just uploaded 5 more videos this week.

    • @khanhphan-ci4lt
      @khanhphan-ci4lt Před 6 lety

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

  • @_Seamock
    @_Seamock Před 4 lety

    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!!

  • @katietownsend8927
    @katietownsend8927 Před 4 lety

    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

  • @labestialceramica2674
    @labestialceramica2674 Před 5 lety

    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

  • @sartajshaikh429
    @sartajshaikh429 Před 6 lety +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

  • @adudas78
    @adudas78 Před 5 lety

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

    • @derekherzog1569
      @derekherzog1569 Před 5 lety

      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"

  • @bernardjunebabierra8669

    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

  • @TheAgvBandit
    @TheAgvBandit Před 6 lety

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

  • @oleksandrruzhylo2193
    @oleksandrruzhylo2193 Před 3 lety

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

  • @michellerodel9749
    @michellerodel9749 Před 3 lety

    It is possible to data validation from other worksheet?

  • @giridharron6755
    @giridharron6755 Před 5 lety

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

  • @Zaakbaatar
    @Zaakbaatar Před 6 lety +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 Před 5 lety +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!

  • @gerardomartinezr1183
    @gerardomartinezr1183 Před 5 lety

    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  Před 5 lety

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

  • @tadeulyrio5166
    @tadeulyrio5166 Před 4 lety

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

  • @sumitrodesalesmanager935

    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..."

  • @prefeituradejoaopessoa1917

    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  Před 6 lety

      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.

  • @fong9615
    @fong9615 Před 5 lety

    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!

  • @4UBeatz
    @4UBeatz Před 6 lety

    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  Před 6 lety

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

  • @emmettsempek
    @emmettsempek Před 4 lety

    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 Před 4 lety

      YOU CAN REFER THE TOP COMMENT

    • @emmettsempek
      @emmettsempek Před 4 lety

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

  • @halee2124
    @halee2124 Před 5 lety +1

    Can this work with a web app?

  • @jonalynfrias5458
    @jonalynfrias5458 Před 4 lety

    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  Před 4 lety +1

      It's probably getActiveSpreadsheet
      Everything is case sensitive.

  • @XMULTIBOX
    @XMULTIBOX Před 4 lety

    Could you plaaaaase put the code somewhere?

  • @chanakankitrak9254
    @chanakankitrak9254 Před 3 lety

    interest

  • @CyframerEX
    @CyframerEX Před 6 lety

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

  • @phoenixempire8886
    @phoenixempire8886 Před 4 lety +1

    🙏🏻

  • @dzilen
    @dzilen Před 4 lety

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

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  Před 4 lety +1

      If you find how let me know :)

    • @JamieMACbid1
      @JamieMACbid1 Před 4 lety

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

  • @alexypolivany7148
    @alexypolivany7148 Před 4 lety

    Spoiler alert- it is not the last video.

  • @omsingh06
    @omsingh06 Před 4 lety

    Can we do without script?

  • @mdmazharulislam9564
    @mdmazharulislam9564 Před 6 lety

    Video Quality is very low