Write datastore entity inserting new row instead of updating

Hello,

I have a requirement that the support team can insert new rows into the table(Using SQL insert statement) as part of application support. After that end users can modify the newly inserted row values from the application.
Somehow write-to-datastore-entity(both smart service & smart function) is inserting again a new row instead of updating the current row.

This is happening when users are trying to update the values for the newly inserted row through SQL insert statement only.


I have tried by setting the valueToStore as rule!getdetailsById(ID:1234).data. No luck, still it is inserting a new row.

Appian V19.3 on-premise

Database: MS SQL server 

Thanks.
 

  Discussion posts and replies are publicly visible

Parents Reply Children
  • In MS SQL server IDENTITY(1,1) is the auto increment configuration.

    It is behaving differently for updating the rows inserted through Insert statement(Here DB generated the new PK value) we are not seeding the PK values.

    Example: I have inserted a row using insert statement and DB generated the PK ID as 1880.
    The user is able to see the new values for 1880 in the Appian UI screen and changed one of the column value A->B and then hits the save button. Here the system is creating a new row 1881 instead of updating 1880.


    The same process is working fine and updating the row successfully if the updating row is inserted through application.
    Example: User submitted a request from Appian application and new PK ID created in database say 1756.
    User edit the details using related action feature and changed one of the column value A->B and then hits the save button. Here the system is successfully updating row 1756.


    I have verified the same scenarios for the different table which has same PK configuration. 
    Is updating the rows in all scenarios.

    CREATE TABLE [dbo].[Mytable2](
    [Per*****Id] [int] IDENTITY(1,1) NOT NULL,
    .

    .

    .


    [BatchId] [int] NULL,
    CONSTRAINT [PK_Mytable2] PRIMARY KEY CLUSTERED
    (
    [Per*****Id] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    GO


    Still, Mytable has issues in updating the row.

    Thanks,
    Venu.