All selected values must be present in the choiceValues array

While calling a interface in another interface, I encountered the error message "All selected values must be present in the choiceValues array". I used same constant in both choice label and choice values i.e. cons!

Below are the supporting documents. Kindly help

      

  Discussion posts and replies are publicly visible

  • 0
    Certified Senior Developer

      

    The value in the local!empData has the value for Employment type as 2.Permanent which does not match with the constant values which is Permanent. You need to check the data that is present in the local!empData. 

    Correct the value either in the constant or check the AE_Convert_API_Response_Data and configure the output accordingly. Please share the rule!AE_Convert_API_Response_Data  Code snippet here.

  • 0
    Certified Lead Developer

    It sounds like you're encountering a mismatch between the selected value and the choiceValues in your dropdown or radio button field. Here's how to resolve it:

    1. Create a New Constant for IDs:

      • If your employee type is stored as an ID (integer), create a separate constant for these ID values (e.g., 1, 2, 3, 4).
      • Use this new constant in the choiceValues field while keeping your existing constant for the choiceLabels.
    2. Use dropdownFieldByIndex() (if IDs are sequential):

      • If the IDs are in order, you can use dropdownFieldByIndex() to simplify the dropdown setup.
    3. Ideal Long-Term Solution:

      • Store your employee types in a database table with columns for IDs, names, and an isActive flag.
      • Use QueryEntity to fetch the choiceLabels and choiceValues dynamically. This approach allows easier updates and potential admin management.

    This should resolve the error and provide a more flexible solution for future change