Almost three years ago I posted a script on how to create cascading drop downs for SharePoint 2013 and SharePoint Online using REST.
Since then I’ve had a lot of comments asking for additional functionality to that script. So, I decided it was time to update the script and make it a little more modular. If you are a user of the previous script, the biggest change you will see is how you execute the cascade function. Now, instead of passing in an object to the cascade functionality, you pass in an array of objects. This allows you to set up multilevel cascading.The updated script can be found on GitHub at https://github.com/mrackley/HillbillyCascade
As always, take a look at the video at the end of the blog post for step by step instructions and to see the script in action.
- Multiple cascades – In the previous script, it only worked for one level. In the updated script you can have as many levels as you’d like. All you need to do is create a new cascade object and add it to the array.
- New and Edit Form – The updated script works well on both new and edit forms.
- Default text for unselected dropdown – You now specify what you want the text of the select to be if nothing has been selected yet
And just like the previous script, you can update the REST query to work with 2010. This solution “as is” will work on SharePoint 2013, 2016, and SharePoint Online for Classic Forms. If you are using the new Modern Forms you cannot customize those forms. You’ll need to look at using something like StratusForms with a SPFx Client Web Part.
The other stuff
There have been a LOT of requests around this script including debugging questions from those who have not been able to implement it correctly. Unfortunately, I simply do not have the time to respond to all of these emails. If you are having issues with the script, I strongly urge you to implement the list structure that I’m using in the video and see if you can make things work as is. It is CRITICAL you use correctly entered List Names, Display Field Names, and Internal Field names where indicated or it simply won’t work.
Anyway, I hope you like the updates! Thanks once more for stopping by.