How to create a drop down list containing many materials and assign to the box. Please help me!

Check this thread and the solution by @AndersDeleuran. It can “automatically” update the keys and values of a dropdown.