Skip to main content
deepaks0008
Known Participant
January 4, 2021
Solved

2 Dropdowns state and county, on changing state no issue. but selecting county and changing state is issue!

  • January 4, 2021
  • 2 replies
  • 0 views

Hi All,

I have state and county drop downs when changed states loading respective county in 2nd dropdown i.e.county dropdown.

When i selected county value and tried change state value, getting error as -

intterface Definition: Expression evaluation error at function a!dropdownField [line 76]: A dropdown component [label=“County”] has an invalid value for “value”. All selected values must be present in the choiceValues array, but value was Beaver and choiceValues was Carson City; Churchill; Clark; Douglas; Elko; etc...

saveInto:  {ri!PTS.state,a!save(ri!target:PTS.County,value:null)}

Thanks,

Deepak

    Best answer by harshitb6843

    Hi,

    I think you are not using a!save() function in the correct way. Try replacing your a!save() function with this

    a!save(ri!PTS.County,null)

    And this should solve the problem.

    Thanks,
    Harshit

    2 replies

    harshitb6843
    Brainy
    January 4, 2021

    Hi,

    I think you are not using a!save() function in the correct way. Try replacing your a!save() function with this

    a!save(ri!PTS.County,null)

    And this should solve the problem.

    Thanks,
    Harshit

    peter.lewis
    Participating Frequently
    January 5, 2021

    If you haven't seen it already, the documentation page on Cascading Dropdowns is pretty similar to what you're doing here. The main tricky part is that if your county depends on the state, you always need to clear out the selected county when a different state is selected (and that's what he other poster suggested here).