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)
Discussion posts and replies are publicly visible
harithab835860 said:update the codes in site
What exactly do you mean with this?
Please share more details and code snippets.
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
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 selectionIn your saveInto, loop through all selected Ids
a!forEach( items: local!selectedNameIds, expression: a!map(id: fv!item, code: local!codeInput) )
a!forEach( items: local!selectedInsuredId, expression: a!localVariables( local!idx: index(fv!item, wherecontains(fv!item, local!insuredParty[partyId]),
null() ), recordType( appianId: index(local!insuredParty[id], local!idx, null()), validated: false, partyID: fv!item, recordType!createdon: now(), recordType!createdBy: loggedInUser(), ) ) ) ),iterating in the same way but 2 rows are getting displayed when 2 names are selected