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

Поделиться
HTML-код
  • Опубликовано: 24 ноя 2024

Комментарии • 99

  • @ExcelGoogleSheets
    @ExcelGoogleSheets  6 лет назад +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 !

  • @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

  • @jdemick
    @jdemick 3 года назад +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!

  • @kyawnaingwin8300
    @kyawnaingwin8300 5 лет назад +1

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

  • @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

  • @zamapon
    @zamapon 3 месяца назад +1

    Superb! You’ve saved the day

  • @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?

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

  • @rockydagalea2422
    @rockydagalea2422 6 лет назад

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

  • @itrauco
    @itrauco 6 лет назад +21

    "var datAss = " in camel case

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

  • @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?

  • @elisivlindroth852
    @elisivlindroth852 5 лет назад +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!

  • @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?

  • @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 6 лет назад

    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.

  • @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?

  • @Bdangzki
    @Bdangzki 5 лет назад +1

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

  • @beyobeya
    @beyobeya 3 года назад

    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!

  • @NgocTran-we1gw
    @NgocTran-we1gw 5 лет назад +2

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

  • @chrislam9189
    @chrislam9189 6 лет назад

    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!

  • @DenisVintage
    @DenisVintage 6 лет назад +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  6 лет назад

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

  • @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

  • @katietownsend8927
    @katietownsend8927 4 года назад

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

  • @_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!!

  • @Avi8053
    @Avi8053 4 года назад +1

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

  • @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

  • @giridharron6755
    @giridharron6755 6 лет назад

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

  • @oleksandrruzhylo2193
    @oleksandrruzhylo2193 4 года назад

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

  • @tomseemu
    @tomseemu 2 года назад

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

  • @michellerodel9749
    @michellerodel9749 3 года назад

    It is possible to data validation from other worksheet?

  • @tadeulyrio5166
    @tadeulyrio5166 5 лет назад

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

  • @berendotto
    @berendotto 4 года назад

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

  • @halee2124
    @halee2124 5 лет назад +1

    Can this work with a web app?

  • @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

  • @adudas78
    @adudas78 5 лет назад

    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"

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

  • @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 лет назад

      ruclips.net/video/rW9T4XZy-7U/видео.htmlS.O.R.531721925318

    • @baynbogd4957
      @baynbogd4957 Год назад

      @@sartajshaikh429 where your link is?

  • @MostafaHosny1
    @MostafaHosny1 6 лет назад

    What an effort!! Thanks a lot

  • @oxpey4473
    @oxpey4473 2 года назад

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

  • @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 5 лет назад +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 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);

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

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

  • @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

  • @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?

  • @frostyzmp
    @frostyzmp 5 лет назад

    Thank you very much !!

  • @pichit.raetai
    @pichit.raetai 4 года назад

    thank you very much

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

  • @omsingh06
    @omsingh06 4 года назад

    Can we do without script?

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

  • @CyframerEX
    @CyframerEX 6 лет назад

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

  • @chanakankitrak9254
    @chanakankitrak9254 3 года назад

    interest

  • @mdmazharulislam9564
    @mdmazharulislam9564 6 лет назад

    Video Quality is very low

  • @1McAna
    @1McAna 4 года назад +1

    Thank you so much!!!!