How to add two drop downs when changing first value changes the next value?

Hi experts, Please help me to solve this one. I need 2 drop-downs, first one is editable and the second one is not editable. When I change the first one the second drop-down should automatically change. For example, if first one is CPU the second one should change into Central Processing Unit.    I have no idea how to set the attributes and how to link the two drop-drops. Can anyone help with this?   Thank you in advance.     EDIT 1:
3 answers


 If your ‘$onboarding/Code’ is a string then you can use an expression like this:

if $onBoardingstaff/code= 'CWO' then 'WareHouse Coordinator' else
if $onBoardingstaff/code='CWN' then 'Warehouse Controller' else

 But if ‘$onboarding/Code’ is an enum, then, an expression like this can help:

if $onBoardingstaff/code= enum.staffcode.CWO then 'WareHouse Coordinator' else
if $onBoardingstaff/code=enum.staffcode.CWN  then 'Warehouse Controller' else

Let me know, if you have any issues,

Hope it helps!!



you can use event handler in use onchange action call a microflow then using change object change another dropdown based on current dropdown value give refresh in client it will work.




As your attribute ‘code’ is an enum and you’re equating it to the string, mendix is throwing an error in that case which is invalid types on LHS and RHS

Instead you can write it in this way
 $OnboadingStaff= Enum_StaffCode.CWO 

where you are equating the attribute to its own expected enum values instead of strings.
This also makes sure that there are no typos.