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
  • 0
    Certified Senior Developer
    Hi Nalini ,

    For choice values it won't allow duplicate values for ignoring that
    can you try the bellow

    load(

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

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

    may it helps you.....

    Thanks
Reply
  • 0
    Certified Senior Developer
    Hi Nalini ,

    For choice values it won't allow duplicate values for ignoring that
    can you try the bellow

    load(

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

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

    may it helps you.....

    Thanks
Children