Write to Data Store Entity Error

Im getting the error when writing to data store:  ... " with identifier value `1007` does not exist  " . This is the value of my primary key I'm trying to insert into the data store. I already have the primary key from user input and I'm trying to write all of the info into an empty data store. (I would share screenshot but it's work information). This is occurring within my process model when I am using the write to data store smart service.  Why is this happening?

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    You’re getting the error because system treats a write with a primary key value as an update, not an insert. Since no record with that key exists, it fails.

    To fix this, when inserting new records, leave the primary key field blank so Appian and the database can auto-generate it. Only provide the primary key when updating an existing record. Additionally, ensure your database table and data store entity are configured to auto-generate primary keys. Verify in your process model that the primary key field isn’t populated during insert operations to avoid this error.

Reply
  • 0
    Certified Lead Developer

    You’re getting the error because system treats a write with a primary key value as an update, not an insert. Since no record with that key exists, it fails.

    To fix this, when inserting new records, leave the primary key field blank so Appian and the database can auto-generate it. Only provide the primary key when updating an existing record. Additionally, ensure your database table and data store entity are configured to auto-generate primary keys. Verify in your process model that the primary key field isn’t populated during insert operations to avoid this error.

Children