Skip to main content
Known Participant
Mar 5, 2022 8:41 PM UTC
Solved

update database in the process model with write to datastore

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 ???

andrewh0007
Inspiring
Mar 6, 2022 5:14 AM UTC

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
Inspiring
Mar 6, 2022 5:14 AM UTC

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?

Known Participant
Mar 6, 2022 10:52 AM UTC

thank you yes it does

New Participant
Mar 6, 2022 5:42 AM UTC

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
Mar 6, 2022 7:28 AM UTC

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.