Multiple Inputs and storing : Appian interface

Certified Associate Developer


Hi ,

I have created a interface in which when I selected a product in "Add product in Cart", It should be populated in Picked products and will show quantity input field. But I don't know  how to store the quantity input  values for different quantity fields, for example If I give quantity value 12 for Soaps it is showing 12 for all product's quantity.

Thanks in advance.

Code for the same below:

a!formLayout(
label: "Buy Products",
contents: {
a!sectionLayout(
contents: {
a!richTextDisplayField(
label: "User",
labelPosition: "JUSTIFIED",
value: user(loggedInUser(), "firstName")
)
}
),
a!sectionLayout(
label: "Add Products in Cart",
contents: {
a!sectionLayout(
label: "",
contents: {
a!pickerFieldRecords(
label: "Pick Products",
labelPosition: "ABOVE",
maxSelections: 20,
recordType: 'recordType!{886fbcf9-c44b-4cc9-bb6e-76529b93d6e5}TS_RecordType_Product',
value: ri!productsSelected,
saveInto: ri!productsSelected,
validations: {}
)
}
),
a!sectionLayout(
label: "Picked Products",
contents: {
a!columnsLayout(
columns: {
a!columnLayout(
contents: {
a!forEach(
ri!productsSelected,
a!columnsLayout(
columns: {
a!columnLayout(
contents: {
a!richTextDisplayField(
labelPosition: "COLLAPSED",
value: index(
a!queryEntity(
entity: cons!TS_Constant_Product,
query: a!query(
selection: a!querySelection(
columns: { a!queryColumn(field: "productName") }
),
logicalExpression: a!queryLogicalExpression(
operator: "AND",
filters: {
a!queryFilter(
field: "ID",
operator: "=",
value: tointeger(fv!item)
)
},
ignoreFiltersWithEmptyValues: true
),
pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 50)
),
fetchTotalCount: false
).data,
"productName"
)
)
}
),
a!columnLayout(
contents: {
a!textField(
label: "Quantity",
labelPosition: "JUSTIFIED",
value: {},
saveInto: {},
refreshAfter: "UNFOCUS",
validations: {}
)
}
),
a!columnLayout(contents: {})
}
)
)
}
),

}
)
}
)
}
)
},
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
)
}
)
)

  Discussion posts and replies are publicly visible