error in mutliple drop down

I have a ref CDT and from the ref CDT i am extracting id and name values using expression rule and using this expression rule as a local variable in the interface (i,e local!ammenityTypeList). Now for choice labels i used the name and for choice labels i used id . For storing these values i am using another CDT which consists of an integer field which is a foreign key.

here my requirement is :

1) when I select the values it's displaying the numbers when it is in read-only format . But I want it to be names! .

2) I should have the option to select my own values but instead, it is selecting all and taking all of the values. 

These are my requirements , can anyone suggest how to solve them.

  Discussion posts and replies are publicly visible

Parents
  • Please find the below code as a reference. 

    To achieve your requirements.

    Store your data retrieved from expression in local variable or directly index on choice labels and choice values,

    Use separate local variable or rule input to store the selected ids. This variable should be of type multiple

    If you want to store these selected ids into another cdt, loop the cdt by the selected ids count.

    a!localVariables(
      local!languages: {
        a!map(id: 1, name: "English"),
        a!map(id: 2, name: "Spanish"),
        a!map(id: 3, name: "French"),
        a!map(id: 4, name: "German")
      },
      local!selectedLanguageIds: {},
      a!multipleDropdownField(
        label: "Language",
        instructions: "Which language(s) are you proficient in?",
        choiceLabels: fn!index(local!languages, "name", {}),
        choiceValues: fn!index(local!languages, "id", {}),
        value: local!selectedLanguageIds,
        saveInto: local!selectedLanguageIds,
        searchDisplay: "AUTO"
      )
    )

  • Thanks for your response, I followed all your suggestions still I am unable to store the values into another CDT when I am choosing values from the dropdown. It is showing empty as shown in the below image

Reply Children