Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9051425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T12:54:06+00:00 2026-06-16T12:54:06+00:00

Need a little help figuring out how to get 3 list boxes to populate

  • 0

Need a little help figuring out how to get 3 list boxes to populate based on the previous list box. So far what I have is 1 list box that populates from a spreadsheet. Can someone help me with setting up so that the 2nd listbox will populate based off the first and a 3rd listbox that will populate based off of the first listbox? Here is the code:

function doGet(e){
  var app = UiApp.createApplication();
  var mainPage = app.createVerticalPanel().setId('mainPage');
  var dataItemsLB = app.createListBox().setId('dataItemsLB').setName('dataItemsLB'); 
  var dataItemsLbl = app.createLabel('Data Items'); 
  dataItems(dataItemsLB);
  mainPage.add(dataItemsLB);
  app.add(mainPage);
  return app;
  }


  function dataItems(listbox){
  var app = UiApp.getActiveApplication();
  var ss = SpreadsheetApp.openById('0AhraBJOts4V3dDhYbERTR0hFNUtNdEhZd2c4OElpY0E');
  var list = ss.getSheetByName('dataItems');
  var values = list.getRange(1,1,ss.getLastRow(),1).getValues();
  for (var i in values){
  listbox.addItem(values[i][0].toString());
  }
  return app;
  }

The code above is only for 1 listbox but I thought it would help me to start from the bottom so I understand any explanation.
Thanks for any advice!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T12:54:07+00:00Added an answer on June 16, 2026 at 12:54 pm

    Replied on community try this code:

    function doGet(e){
      var app = UiApp.createApplication();
      var mainPage = app.createVerticalPanel().setId('mainPage');
      var dataItemsLB = app.createListBox().setId('dataItemsLB').setName('dataItemsLB'); // create a basic list box
      var dataItemsLB2 = app.createListBox().setId('dataItemsLB2').setName('dataItemsLB2'); // create a basic list box
      var dataItemsLB3 = app.createListBox().setId('dataItemsLB3').setName('dataItemsLB3'); // create a basic list box
      var dataItemsLbl = app.createLabel('Data Items'); 
      dataItems(dataItemsLB); // call the "dataItems" function to populate the list box
    
    
      // Create Server Handlers
      var sHandlerLB = app.createServerHandler("listLBSelect");
      sHandlerLB.addCallbackElement(mainPage);
      dataItemsLB.addChangeHandler(sHandlerLB);
      dataItemsLB2.addChangeHandler(sHandlerLB);  
    
      mainPage.add(dataItemsLB);
      mainPage.add(dataItemsLB2);
      mainPage.add(dataItemsLB3);
      app.add(mainPage);
    
      return app;
    }
    
    
    function dataItems(listbox){
      var app = UiApp.getActiveApplication();
      var ss = SpreadsheetApp.openById('0AhraBJOts4V3dDhYbERTR0hFNUtNdEhZd2c4OElpY0E');
      var list = ss.getSheetByName('dataItems');
      var values = list.getRange(1,1,ss.getLastRow(),1).getValues();
      for (var i in values){
        listbox.addItem(values[i][0].toString());
      }
      return app;
    }
    
    function listLBSelect(e) {
      var app = UiApp.getActiveApplication();
      Logger.log(e);
      Logger.log("Listbox changed: " + e.parameter.source);
      // check which listbox has been changed:
      switch(e.parameter.source) {
        case "dataItemsLB":
          var dataItemsLB2 = app.getElementById("dataItemsLB2");
          dataItemsLB2.addItem("aaaaaa"); 
          dataItemsLB2.addItem("bbbbbb"); 
          dataItemsLB2.addItem("cccccc"); 
          break;
        case "dataItemsLB2":
          var dataItemsLB3 = app.getElementById("dataItemsLB3");
          dataItemsLB3.addItem("hhhhhh"); 
          dataItemsLB3.addItem("jjjjjj"); 
          dataItemsLB3.addItem("kkkkkk"); 
          break;     
      }
      return app;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need a little help figuring out what the following URL rewrite rule means.
I know I'm close to figuring this out but need a little help. What
Hey all i am in need of a little help with figuring out how
Need a little help again. Say I have an unordered list, and I want
I need a little help figuring this out because I'm new to stored procedures.
Need a little help with a solution for this problem. I have a list
I'm just figuring out my way around rails but I need a little help
I just need little help, that is: many times i have seen http://www.xyz.com/index.jsp?etetet%rr^_frfwrw.... .
need a little help with this one. I have a form that I am
I would need little help here. I'm trying to get the git respository from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.