How to not inset the duplicates into the database

Hi All,

code:-

!buttonArrayLayout(
buttons: {
a!buttonWidget(
label: "Create",
saveInto:{

a!forEach(items: local!filter,expression:a!save(local!items, append(local!items,{customerid: local!filter.customernumber[fv!index], tag: local!filter.tag.tagname[fv!index], portfolioname: local!filter.value[fv!index], portfolioid: local!filter.customerid[fv!index], tagid: local!filter.tag.tagid[fv!index]}))),

a!writeToDataStoreEntity(
dataStoreEntity: cons!portfoliomasterorg,
valueToStore: local!items
in the above code i am trying to insert the data into Db. how to not insert the duplicates into DB. Please help me to resolve the issue.
Thank you

  Discussion posts and replies are publicly visible