Skip to main content
March 5, 2022
Solved

update database in the process model with write to datastore

  • March 5, 2022
  • 4 replies
  • 0 views

Hi everyone 

im new with appian and im trying to understrand how can i update for exemple a record in  table in my db , in the process model.

i see that we only have a node for write in the datastore , but what is the best practice to update a specific row with the id etc.. like in SQL.

How we doing this with the configuration with that node of write to datastore entity ???

Best answer by andrewh0007

If you provide a value for the primary key that already exists (in your screenshot it appears to be `idCreditRequest`) then it will update that row.

If no primary key is provided and it is an auto increment key then a new row is created.

If a value for the primary key that doesn't already exist is provided then a new row is created with the specified primary key.

Does this give enough guidance?

4 replies

andrewh0007
March 6, 2022

If you provide a value for the primary key that already exists (in your screenshot it appears to be `idCreditRequest`) then it will update that row.

If no primary key is provided and it is an auto increment key then a new row is created.

If a value for the primary key that doesn't already exist is provided then a new row is created with the specified primary key.

Does this give enough guidance?

March 6, 2022

thank you yes it does

March 6, 2022

Hi,

If your intention is only to update a record We do have Query Database smart service, In which you can provide a update query similar to SQL by giving where condition as your primary key. Hope this helps!!

stefanhelzle0001
Brainy
March 6, 2022

There is no field level update. Load the CDT row from DB, change the fields as required and store the row back to DB.

I highly recommend to NOT use the Query Database smart service. It will not work in conjunction with synchronized records.