Interface Definition: Expression evaluation error at function a!dropdownField [line 9]

Could not display interface. Please check definition and inputs. Interface Definition: Expression evaluation error at function a!dropdownField [line 9]: A dropdown component [label=“Category”] has an invalid value for “value”. All selected values must be present in the choiceValues array, but value was 2 and choiceValues was 1; 2; 3; 4.

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    A Score Level 1
    in reply to nellorea0001

    To clarify -

    Consider the following code block.

    a!dropdownField(
        choiceValues:{1,2,3,4},
        choiceLabels:{1,2,3,4},
        value:"2"
    )...

    This will give you an error of  - Interface Definition: Expression evaluation error at function a!dropdownField [line 12]: A dropdown component [label=“”] has an invalid value for “value”. All selected values must be present in the choiceValues array, but value was 2 and choiceValues was 1; 2; 3; 4.

    This is because the value is a string, and not an integer, therefore it is not 2, it is "2".

     

    By casting the value to the same type as the choiceValues (from a string to an integer), you would be able to fix this problem.

    E.G: 

    a!dropdownField(
        choiceValues:{1,2,3,4},
        choiceLabels:{1,2,3,4},
        value:tointeger("2")
    )...

     

    This may not be the solution to your problem, however without more context, that is the immediate problem that pops into mind for me.

     

    Hope this is helpful!