fetch Data from a db column to drop down component

Hi All,

 

I'm trying to fetch data form one of the column of database to the drop down component on UI.

Column has redundant data e.g india,india,india, in 100 rows let say.

I'm using index(local!variable,"columnname" {}) function, but it is throwing error.. Duplicate items are not allowed in the choice Values array.

Please guide on this ..

 

TIA,

Nalini 

  Discussion posts and replies are publicly visible

Parents
  • Hi Nalini,

    I am guessing the table which you are using the populate the data in your drop down component is not lookup table. So use look up table from where these data (india,india,india,......) is coming then your drop down will work, no need to use any functions.

    But still you are facing the issue then use code suggested by Prakash with slightly change,it will give you better performance :

    load(

    local!data:index(local!variable,"columnname" {})
    local!dropDownOptions: union(
    local!data,
    local!data
    ),
    -------
    -------
    ------..etc,
    a!dropdownField(

    label: " ",
    placeholderLabel: "--select --",
    choiceLabels: local!dropDownOptions,
    choiceValues:local!dropDownOptions,
    value: {},
    saveInto:{}
    )

    Regards
    Abhay
Reply
  • Hi Nalini,

    I am guessing the table which you are using the populate the data in your drop down component is not lookup table. So use look up table from where these data (india,india,india,......) is coming then your drop down will work, no need to use any functions.

    But still you are facing the issue then use code suggested by Prakash with slightly change,it will give you better performance :

    load(

    local!data:index(local!variable,"columnname" {})
    local!dropDownOptions: union(
    local!data,
    local!data
    ),
    -------
    -------
    ------..etc,
    a!dropdownField(

    label: " ",
    placeholderLabel: "--select --",
    choiceLabels: local!dropDownOptions,
    choiceValues:local!dropDownOptions,
    value: {},
    saveInto:{}
    )

    Regards
    Abhay
Children