Skip to main content
February 20, 2023
Question

Update an existing value in Data table using Write to Data Store Entity smart service

  • February 20, 2023
  • 2 replies
  • 0 views

Hi everyone, apologise if this question has been asked before as I couldn't find the it anywhere :)

I want to update date time value of 2 columns (createdDateTime and updatedDateTime)  in my data table by using Write To Data Store Entity.  I already have a CDT that has primary key matching with my data table.

For configuring Write to Data Store smart service node, I want to config this node to update the 2 columns (createdDateTime = pv!createdDateTime  and updatedDateTime = pv!updatedDateTime) where Id (primary key column) = pv!id.

How do I achieve that? Thank you!

P/s:  I tried Execute Store Procedure smart service but not sure why it updated only 1 column with my input date time, but the other column was not updated, and I couldn't find the reason for that. That's why I tried to change to Write To Data Store Entity to see if this works

    2 replies

    stefanhelzle0001
    Brainy
    February 20, 2023

    Appian treats the database just like any other external system. In this case, the use protocol is JDBC. Now, to change any data, you need to load it, modify it, and write it back to the DB.

    Depending in your use case, this might include a!queryEntity or a!queryRecordType, a!update and a Write to Data Store smart service.

    venkatrea696188
    February 20, 2023

    First Fetch data from Table (Where you want to edit columns), then update those two(Use process variable as array), And write them back to database