Append in Dropdown

Hi,

 

I have list of rows but i am displaying only limited set of rows. Now  i need to add one dropdown for an existing data.

But one catch here is that , that dropdown should display existing data on top of dropdown rest below that.

I had tried to achieve this and it got added also.But when i clicked on add new row button than i am getting below error.

Can you check the way i have written this correct or i should think another approach.

Code is like :

 

ri!sampleTest- I am passing to rows.

columnConfigs->rows: a!applyComponents( Calling new rule and passing index)

a!dropdownField(
label: "Sample",
choiceLabels: append(if(rule!APN_isEmpty(ri!sampleDS[ri!index].sdTest),{},
union(
ri!sampleTest[ri!index].sdTest,
ri!sampleTest[ri!index].sdTest
)),"Test"),
choiceValues: append(if(rule!APN_isEmpty(ri!sampleDS[ri!index].sdTest),{},
ri!sampleTest[ri!index].sdTest,
ri!sampleTest[ri!index].sdTest
)),"Test"),
placeholderLabel: "-- Select Sample Type --",
value: ri!sampleDS[ri!index].sdTest,
saveInto: {ri!sampleDS[ri!index].sdTest},
required: true()
),

 

Error :-

Error Evaluating UI Expression

Expression evaluation error in rule 'layout_s' (called by rule 'form_f') at function a!applyComponents [line **]: A dropdown component [label=“Labal”] has an invalid value for “choiceValues”. Duplicate items are not allowed in the choiceValues array, but choiceValues was Test; Test.

  Discussion posts and replies are publicly visible