I am currently working on designing a drilldown question for department selection in my company. The first dropdown allows users to select the department they work in, and the second dropdown allows them to select the specific function within that department. However, I have encountered a challenge when it comes to departments that do not have any functions beneath them.
To address this issue, one of our stakeholders has requested that we remove the second dropdown entirely when certain departments are selected in the first dropdown, instead of displaying an empty dropdown or having a "Not Applicable" option. Unfortunately, using a display rule with embedded data is not suitable in this case, as the data does not get transferred to the embedded variables until we move to the next question and return to this page.
I'm not a Java Script expert, but I'd like a Java Script solution to this problem.