Hi. I have a dropdown list that fails when selecting one of the values. Here i

Hi. I have a dropdown list that fails when selecting one of the values. Here is the SAIL:
a!dropdownField(
label: "Regulation",
labelPosition: "ABOVE",
placeholderLabel: "--- Select a Value ---",
choiceLabels: rule!PMA_GetAllRegulations().name,
choiceValues: rule!PMA_GetAllRegulations().id,
value: ri!property.regulationId,
saveInto: ri!property.regulationId,
validations: {}
),

This is the error message:

Expression evaluation error at function a!dropdownField [line 136]: A dropdown component [label=“Regulation”] has an invalid value for “value”. All selected values must be present in the choiceValues array, but value was 1 and choiceValues was 1; 2.

The value 1 is correct and it exists in the choiceValues, so I do not understand why it fails.
Thanks
Bjarte

OriginalPostID-208351

OriginalPostID-208351

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    @Bjartek: at this point I usually like to view the base value of the local variable, removing the dropdown from the equation altogether (unitl you find the issue).

    This is what I'd do:
    1) comment out the dropdown field
    2) add a new Paragraph field, label: "DEBUG", value: local!allRegulations
    3) try and identify whether there might be something wrong with the local value explaining why the dropdown is acting this way.
Reply
  • 0
    Certified Lead Developer
    @Bjartek: at this point I usually like to view the base value of the local variable, removing the dropdown from the equation altogether (unitl you find the issue).

    This is what I'd do:
    1) comment out the dropdown field
    2) add a new Paragraph field, label: "DEBUG", value: local!allRegulations
    3) try and identify whether there might be something wrong with the local value explaining why the dropdown is acting this way.
Children
No Data