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

Parents Reply
  • 0
    Certified Lead Developer
    in reply to Chris

    I think it would be WONDERFUL feature if Appian allowed a way to configure DB node or function to ONLY write or ONLY update, else throw error and pause the process / pink box.  The fact that it's determined at runtime, even though via very explicit and predictable rules, does lead many a developer to problems like this, and adds a bunch of time for all of us to trick it into only doing what we want.

Children
No Data