Skip to main content
osamag0001
March 22, 2022
Question

I want to update a row when save to data store entity instead of generate a new row with a new id

  • March 22, 2022
  • 3 replies
  • 0 views

In this case the financial review pass data to office manager 

when office manager click return to financial department in the interface it should get back to the financial executive to review the interface

the problem is with this loop the second time the financial executive submit the form it written as a new row , i need this second review to be an update to the first row

the second problem is that the office manager cannot open his form after second financial form submission 

3 replies

viraty527193
March 22, 2022

Hi osamag0001,

The Write to Data Store Node will take the data input to write the values to the database.

In case the primary key column is empty for the data to write, it will create a new row in the database, in order to update the existing row please make sure the CDT you are passing to write to datastore has the primary key column with the value of the row you want to update.

You can check the process history in order to clarify when the primary column of the CDT is set to null.

Also, please make sure for the first time you are writing the data, you are also storing the output, it will return the CDT with the primary key, which you can use while updating.

Hope this helps

gopalk2865
Participating Frequently
March 22, 2022

Hi, if your process variable does not have primary key then while writing the data using write to datastore entity will treat this record as new but if your pv has primary key available then it will update the existing record. So make sure you have primary key available in your pv if you are updating any existing record in db.

harshitb6843
March 22, 2022

Yeah. Exactly. I think you are correct [mention:19af3f53b369430eb672b9f520d736bb:e9ed411860ed4f2ba0265705b8793d05]