2

I am working on an enterprise wiki site collection inside an on-premise SharePoint enterprise server 2013.Now I want to add 2 cascading drop-down lists inside my enterprise wiki page layout. As follow:-

  • First drop-down list named “company”.
  • Second drop-down list named “department”
  • Departments should be populated based on the selected company.

So can anyone advice which approach I can follow to have 2 cascading drop-down lists inside my enterprise wiki page layout?

Now I am thinking to implement something as follow:-

  • Create 2 site columns of type drop-down lists with empty choices.
  • Add these 2 site columns to my enterprise wiki page layout.
  • Create 2 custom lists named “company” & “department”.
  • Define a lookup column inside the department list which references the company list.
  • Create a console application and schedule it to run each let say 10 minutes, which will add the items inside the company list as choices inside the “company” site column, and do the same for the department list and department site column.
  • Then to add a JavaScript inside my page layout, the JavaScript will get fired when the user select/change the company choice (when creating/editing a wiki page). and by doing some rest api calls to the department list, and get the departments items which are related to the selected company, I can then hide all the department choices which is not related to the selected company. so in this way only the department choices which are related to the selected company will be shown ..

Now in theory the above should achieve what I am looking for.. but can anyone advice if there is a more straightforward/simpler approach I can follow? And is my above approach a valid appraoch to go for?

Note:- now i can't use lookup columns in my case because if I define the two columns as lookup fields, then I will not be able to define these lookup columns inside my Managed Navigation settings for my wiki page library (Page library >> settings >> Metadata navigation settings >> Configure Navigation Hierarchies ),, as Managed Navigation can only uses columns of type; content type, metadata & choice column,, but it does not allow to define lookup columns, as follow:- enter image description here

here is another link which describe why i can not use lookup fields in my case How to setup Metadata Navigation to include Lookup field values?

2

Why make it so complex ? :)

It looks to be simple requirement that can be achieved using SPServices Cascade dropdown.

Just create 2 lists, Company and Department.

In the department list, create a lookup column which will lookup to the Title column in Company list.

In your page layout's content type or Master page gallery, create two lookup columns which will lookup to the above 2 lists' title columns.

Now in the Page layout creation and edit page(dispform.aspx or editform.aspx , not sure about it in wiki site coll) add references to jQuery and SPServices.

After that follow below links for Step by Step guidance -SharePoint 2013: Cascade Dropdowns using SPServices

Two level cascading dropdown in SP2013 using SPServices

Absolutely no need for console app or timer job etc. This can be easily achieved without such heavy lifting.

SPServices github link

General Instructions to use SPServices

  • 1
    did you have the time to check my above comment.. thanks – john Gu Feb 22 '17 at 16:10
  • 1
    yeah i checked and understood it , unfortunately dont have simpler answer right now. – Gautam Sheth Feb 23 '17 at 5:07
  • 1
    so seems using lookup columns + SPServices are not going to work in my case as this will limit using the Metadata navigation for my wiki pages.. is this correct ? – john Gu Feb 23 '17 at 10:54
  • 1
    yes lookup + spservices wont work here – Gautam Sheth Feb 23 '17 at 11:05
  • 1
    So is the approach i proposed a way to try ? the only issue i can see in the appraoch i proposed is that it is a bit complex and require some development time.... so i was asking if there is a simpler appraoch i can follow to achieve cascading lists taking into account that i want the 2 columns (“company” & “department”) to be used inside the Metadata navigation for my list.. – john Gu Feb 23 '17 at 11:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.