a!localVariables( local!lineOfBusiness: rule!LCM_getLineOfBusinesses(lobkey: null(), lobcode: null()), local!attorneys: rule!LCM_getAttorneys(soeid: null(), attorneykey: null()), local!selectedAttorney, local!selectedAttorneyLOB, local!attorneyLOB: { a!map(attorneykey: null(), lobkey: null()) }, a!formLayout( label: "Form", contents: { a!boxLayout( label: "Attorney - Line of Businesses", contents: { a!gridLayout( label: "", labelPosition: "ABOVE", totalCount: count(local!attorneyLOB), headerCells: { a!gridLayoutHeaderCell(label: "Attorney(s)"), a!gridLayoutHeaderCell(label: "Line of Business"), a!gridLayoutHeaderCell(label: "") }, columnConfigs: { a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight: 1), a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight: 1), a!gridLayoutColumnConfig(width: "ICON") }, rows: { a!forEach( items: local!attorneyLOB, expression: a!gridRowLayout( contents: { a!dropdownField( label: "Attorney(s)" & fv!index, labelPosition: "ABOVE", helpTooltip: "Attorney(s)", placeholder: "Select a Attorney", choiceLabels: index(local!attorneys, "name", ""), choiceValues: index(local!attorneys, "attorneykey", ""), value: fv!item.attorneykey, saveInto: { fv!item.attorneykey, a!save( target: ri!intakeattorneys, value: a!forEach( items: local!attorneyLOB, expression: {AttorneyKey: fv!item.attorneykey} ) ) }, required: true ), a!multipleDropdownField( label: "LOB" & fv!index, labelPosition: "ABOVE", placeholder: "Select a Line of Business", choiceLabels: index(local!lineOfBusiness, "lobname", ""), choiceValues: index(local!lineOfBusiness, "lobkey", ""), value: fv!item.lobkey, saveInto: {fv!item.lobkey, a!save( ri!attorneyLineOfBusiness, value: a!forEach( items: local!attorneyLOB, expression: {attorneykey: fv!item.attorneykey, lobkey: a!forEach( items: fv!item.lobkey, expression: {lobkey: fv!item} ) } ) ) }, required: true ), a!imageField( label: "delete " & fv!index, images: a!documentImage( document: a!iconIndicator("REMOVE"), altText: "Remove", caption: "Remove ", link: a!dynamicLink( value: fv!index, saveInto: { a!save( local!attorneyLOB, remove(local!attorneyLOB, save!value) ) }, ), showWhen: fv!index > 1 ), size: "ICON" ) } ) ) }, selectionSaveInto: {}, validations: {}, shadeAlternateRows: true, addRowLink: a!dynamicLink( label: "Add", saveInto: { a!save( local!attorneyLOB, append(local!attorneyLOB, save!value) ) } ), rowHeader: 1 ) }, style: "STANDARD", marginBelow: "STANDARD" ) }, buttons: a!buttonLayout( primaryButtons: { a!buttonWidget( label: "Submit", submit: true, style: "PRIMARY" ) }, secondaryButtons: { a!buttonWidget( label: "Cancel", value: true, saveInto: ri!cancel, submit: true, style: "NORMAL", validate: false ) } ) ) )
I have a user input with editable grid where each row will have 2 dropdowns.
The first dropdown "Attorney(s)" is a single selection where as "Line of Business" is a multiselection.
I have able to save the attorneykey to the rule input (black arrow in the image), where as I was unable to save/pass lobkey (multiple values) into the rule input.
Can someone give an idea who can I fix this. Thanks in advance.
Discussion posts and replies are publicly visible
You would need to populate it in-process prior to your user input task. Though I don't think it should really be necessary to have a "default row" - just validate that the users add at least one.
Thanks for your reply.
I don't user input task. I am attaching the SAIL form to the process start node.
Not sure how I can achieve.
You can always off-shift your editable grid rows into a local variable instead of directly reading/writing to the Rule Input - in that case you'd declare a "blank" one initially in the local variable definition, then in the "submit" button you'd add an a!save() statemen that mirrors the value of the local variable into the rule input.
Thank you so much for all your explanations. I really appreciate.
Hi Mike,
One strange issue which I am facing is, the RecordType which I am using to refer Child CDT is not getting synced once the data is saved through Parent CDT.
If I ran DataSync, manually then I was able to see in the front-end.
Any tips please.
Thanks.
If you're in Appian 22.2 already, you could try using the "Sync Records" smart service node to force syncing of the child element. Otherwise I'm unsure - my assumption so far was that the Write to DSE Node caused syncing to happen, but I'm unsure how nested CDTs are handled there.
We are currently using 21.4.