Skip to main content
March 18, 2025
Solved

Write Records Smart Service Keeps Creating New Record Instead of Updating

  • March 18, 2025
  • 2 replies
  • 0 views

I'm new to appian and I’m trying to update specific fields (status and step) of a record in my Process Model using the Write Records Smart Service, but instead of updating, it keeps creating a new record.

What I’m Doing:

  1. I pass the record to a form where the user can approve or reject it.
  2. When the button is pressed, I update the status and step values using a!save().
  3. I then pass ac!record to pv!record.
  4. Finally, I use the Write Records Smart Service to save the changes.

Issue: Instead of updating the existing record, the Write Records node creates a new record.

Best answer by daiw

check the primary key field is populated prior to hitting the node, also make sure the record type output goes back to your pv so you can see the data on the way back out as well. Sometimes, adding a user task node inbetween nodes where data is being transformed and then written can help you see the journey the data type goes through. Within the History tab of the process though you should be able to see everything.

2 replies

daiwAnswer
March 18, 2025

check the primary key field is populated prior to hitting the node, also make sure the record type output goes back to your pv so you can see the data on the way back out as well. Sometimes, adding a user task node inbetween nodes where data is being transformed and then written can help you see the journey the data type goes through. Within the History tab of the process though you should be able to see everything.

March 19, 2025

Hi [mention:075af5a4d70a4fb7ba63d7dcedf75b8f:e9ed411860ed4f2ba0265705b8793d05] 

Please check below mentioned points -

1. Does pv!record has primary key value(A primary key, also called a primary keyword, is a column in a relational database table that's distinctive for each record).

2. To update existing data, the record must include a primary key value. Make sure the pv has primary key before passing to Write Records node. 

Please refer this for more details : Update existing records