Drop down List

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 ?

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    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.

Reply
  • 0
    Certified Lead Developer

    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.

Children
No Data