How to update conditional dropdown in a deluge script?

How to update conditional dropdown in a deluge script?

I have a conditional dropdown in my forms (Single select drop down buttons configured as described here: https://www.zoho.com/creator/help/fields/configuring-conditional-drop-downs.html) and need to be able select their values in a script. Script is called on user input of another field. I have no problem with updating the Country equivalent but when script attempts to update the State equivalent it doesn't work. I see that the correct values is pushed to the lookup field but it is deleted after a second. I debugged the output that is responsible for this part of script and in both cases I'm passing IDs corresponding with proper Country and Country-State records, not text values.
How can I resolve this problem?