locked
Drop down list question RRS feed

  • Question

  • Hi,

    I have an office 365 tenancy in my business and maintain it myself. I'm not much of a programmer however. I want to create a drop down list that populates another list. Not quite a cascading dropdown. I have four lists and would like the initial dropdown to contain the names of the four lists. List1, List2, List3 and List4. Depending upon the users choice, I'd like the second dropdown to be populated with the contents of the list selected. I have the lists created in the upper level site of the site collection. Can I create this list in a sub site? Thank you for your time.

    Saturday, September 24, 2016 3:51 PM

Answers

  • We can wait until anyone else has any opinions, but this is what I would do in your situation.

    If you do all the work, and send me what your form html is (you can get that using devtools). I'll just write you up a JavaScript file that you can then, put on your page. 

    No worries about fees, sharing is caring.


    Saturday, September 24, 2016 10:02 PM

All replies

  • What you are hoping to achieve is essentially a cascading list. Unfortunately, this will need to be a custom solution using JavaScript as there are no out of the box features to do this for you. However, what is the intended functionality once they are able to click the last dropdown? When they select the item from the list, what is it supposed to do?
    Saturday, September 24, 2016 6:45 PM
  • Hi. I want the user to select an item that will be saved in a list field. More specifically, I've created three lists, lab tests, Radiology studies and procedures. Ultimately I want to associate a patient with one of these items. Ex: John Doe, Chest X-ray, 1/1/2016. The initial drop down would contain the name of the three lists, and when one list is selected the associated drop down would be populated with the items from that particular list, thereby allowing the user to choose an item. This seems a bit different from my understanding of cascading drop downs, namely Country, State, City. Regards
    • Edited by Steve_Doc Saturday, September 24, 2016 7:44 PM
    Saturday, September 24, 2016 7:43 PM
  • Hi, i see. Yes It is a little difficult but below would be the easiest implementation. Mind you, your data would not be stored in the same field on your list, but 3 separate fields.

    What you will want to do is create a List and add a lookup field for all the 3 lists. Say, "New List" which has 3 lookup columns "Radiology Studies", "Procedures", "Lab Tests". 

    That way, on your New Form, you can select values from one of these three lists. I would then create a standard choice field on that list that contains the List Names. (Make sure the ListName matches the Dropdown choice). 

    Then using JSLink or a script editor webpart, I can write you a piece of JavaScript to show and hide the 3 separate fields on your form (which will have a populated drop down list of your items). So by default the 3 lookup fields are hidden on your form (using CSS). Then when a user selects "Radiology Studies", we can show the "Radiology Studies" lookup field (a dropdown), and allow the user to select the radiology study. Would this suffice?

    Saturday, September 24, 2016 8:16 PM
  • Hi. I was hoping to store all information in one field, much like a cascading dropdown list. What I believe you are proposing is to hide the unused drop downs. If we can't do it where one field is populated with information from any of the three lists, I'll just add look up fields to all lists in my form and have the user select one of the three depending upon the situation at that point in time. I' like the first choice better.
    Saturday, September 24, 2016 8:31 PM
  • Well you could still store the value in another field. We could add 1 more field to your list which holds the value. Then with the JavaScript file I could write you, we could populate that field with the value from the dropdown that was selected :)

    Saturday, September 24, 2016 9:01 PM
  • Do you believe this is the best solution.? When you say, write the JavaScript, how would that work? I guess I was looking for general direction so I could create the solution. I'm not familiar with how this works. What are your fees?
    Saturday, September 24, 2016 9:27 PM
  • We can wait until anyone else has any opinions, but this is what I would do in your situation.

    If you do all the work, and send me what your form html is (you can get that using devtools). I'll just write you up a JavaScript file that you can then, put on your page. 

    No worries about fees, sharing is caring.


    Saturday, September 24, 2016 10:02 PM
  • Hi. Should I copy the HTML directly into this post?
    Sunday, September 25, 2016 1:31 PM
  • that or put it on one drive. Bcameron@aerieconsulting.com
    Sunday, September 25, 2016 10:32 PM