Can we dynamically influence a SELECT dropdown based on previous SELECT's option in a plugin?
Hi team,
I need to create a plugin where based on user's input in one SELECT dropdown, the next SELECT dropdown's data will be shown. Basically, the second one will be dynamically populated based on first one's selection.
I did come across this dataiku community question, however this only talks about multiple select parameters which are independent of each other.
I want to achieve this without having to create a separate custom UI altogether. Is there any solution?
This is how my do function looks like:
I tried using config['previous_parameter_name'] to get the previous details but it did not work(highlighted part)
Thanks, any leads are appreciated.
Best Answer
-
Hi again,
You code and recipe.json are correct, the problem seem to be coming from DSS side.
After investigation, I saw that there were some issues on dynamic selects in version 9.0.4 and older. If you update to 9.0.5 or later you will be able to do what you want.
Answers
-
Hi,
You can indeed use the value from config to populate a SELECT parameter based on another one's selection. The code you showed seemed to have a syntaxe issue, but the idea was correct. Here's an example of how you could do it, with 2 parameters A and B:
-
Hi @Célian
, thankyou for replying.I tried executing your code, however, the second drop-down still was not populating. I could see data in first drop-down but upon selection any option( A1/B1) nothing was shown in second one.
Could you help me in pointing out what might be wrong here?
This is how my recipe.json looks for the two parameters :
The drop-down :
The code :