a!dropdown() field error

Certified Associate Developer

Hi All,

I am facing one issue in dropdown field. I have 4 interface and dependency is mentioned below:

  • 1 is calling 2 and 3
  • inside 2 i have a ruleinput called ClickedTileNo
  • Inside 3 is calling 4
  • inside 4 i have Filter and Grid (I am passing this ClickedTileNo inside this interface)

Now in 4th Interface i am using dropdown as filter

{

a!localvariables(

local!id: null,

local!name:null,

local!data: rule!getdata(id:local!id, name:local!name, approver: if(contains({1,2,3},ri!ClickedTileNo),1,0)),

local!filter: rule!getdata(id:local!id, name:local!name, approver: if(contains({1,2,3},ri!ClickedTileNo),1,0)).data,

local!filterId:{Union(local!filter.idt,local!filter.id)},

{

a!columnsLayout(

columns: {
a!columnLayout(
contents: {
a!dropdownField(
label: "ID",
labelPosition: "ADJACENT",
placeholderLabel: "--- Select ID---",
choiceLabels: local!filterID,
choiceValues: local!filterID,
value: local!Id,
saveInto: local!id
)
},
width: "MEDIUM"
),

)

/***** i have below code for Grid which i am not mentioning here */

}

)

now when the ClickedTileNo value is changing the dropdown values are also getting changed but when i am selecting any value from the dropdown and then changing the ClickedTileNo i am getting below error

function a!dropdownField [line 171]: A dropdown component [label=“ID”] has an invalid value for “value”. All selected values must be present in the choiceValues array, but value was 000045678 and choiceValues was 143256

COuld someone pls help

  Discussion posts and replies are publicly visible

  • +1
    Certified Lead Developer

    The error message simply indicates that due to whatever your data is doing, the array "local!filterID" no longer contains the value contained in "local!Id".  If you're performing other changes on the interface that cause the "local!filterID" array values to change, then you should also save "null()" into local!Id thus resetting that dropdown.

    It's hard to tell any more specifics of why exactly this might be happening within your setup, just due to the complexity of what you've described - I suggest you try writing a one-screen interface using local test data (something that could be copied and pasted into any environment and work), simply to better understand the workings of these components, and post it here (also: when posting code, please be sure to use the Insert --> Insert Code functionality found in the menus here; what you've posted above is pretty hard to read as it is).