Skip to main content
February 16, 2026
Solved

saving multiple rows in database

  • February 16, 2026
  • 8 replies
  • 0 views

I have a multiselect dropdown with names h1, h2 and there respective ids are 123,456. the interface is to update the codes in site.But when I am selecting both values from dropdown and adding the code, code is not getting added for both the values. It is only getting added for the first value(h1) which I selected initially in the dropdown(h1)

    Best answer by stefanhelzle0001
    update the codes in site

    What exactly do you mean with this?

    Please share more details and code snippets.

    8 replies

    stefanhelzle0001
    February 16, 2026
    update the codes in site

    What exactly do you mean with this?

    Please share more details and code snippets.

    February 16, 2026

    In UI I have option to add data using addRowLink. Once I select one name consider h1, then I click on addRow then there I can write any alphanumeric code and I am storing that in backend. but if I am selecting multiple names(2) then if I click on addRowLink 2 new row boxes are being displayed. In UI even if I select multiple names only one row should be displayed and in backend the code should be updated for all selected names. no submit button is available in that interface

    shubhama926776
    February 16, 2026

    You're only saving for the first selected value. Use a!forEach() to iterate all selections.
    I think, Your addRowLink is creating rows based on dropdown selection count.
    Instead:
    Don't use dropdown length to determine rows - always show one row regardless of selection
    In your saveInto, loop through all selected Ids

    a!forEach(
         items: local!selectedNameIds,
         expression: a!map(id: fv!item, code: local!codeInput)
       )

    This updates the same code for all selected names in one action