Skip to main content
Inspiring
December 10, 2023
Question

Drop down List

  • December 10, 2023
  • 1 reply
  • 0 views

a!dropdownField( label: "Deposit Amount", labelPosition: "ABOVE", placeholder: "--- Select ---", choiceLabels: a!forEach( items: rule!CD_QE_Get_Amounts().data, expression: fv!item.amountFrom & " - " & fv!item.amountTo ), choiceValues:a!forEach( items: rule!CD_QE_Get_Amounts().data, expression: fv!item.amountFrom & " - " & fv!item.amountTo ), value: {local!DBben.Amount}, saveInto: {local!DBben.Amount}, searchDisplay: "AUTO", required: true, validations: {} )

Hello All, 

I am facing this error "has an invalid value for "value". All selected values must be present in the choiceValues array, but value was -∞ and choiceValues was 100000 - 500000; 500001 - 1000000; 1000001 - 2000000;"

any advice ?

    1 reply

    stefanhelzle0001
    Brainy
    December 10, 2023

    My first advice is:

    Then, querying data directly inside a UI component is not a good idea, as it fetches the data again on every user interaction. Store the data in a local variable instead.

    Next, what data type is that field "Amount"? Is that an integer? If yes, integers in Appian are limited to 2^32 with a range from -2,147,483,647 to 2,147,483,647.

    Finally, when reading the error message, you will see that you try to assign a value to the drop down for which the drop down has no choice. That will not work. One option might be to check whether the value is in the list of choice values and use a null value in case it is not.