Skip to main content
November 10, 2022
Question

How to add a new entry into table using a!writeRecords?

  • November 10, 2022
  • 11 replies
  • 0 views

Hi,

I am trying to use a!writeRecord function in an interface button save into block. Below is my code. Id is a Primary Key and is set as AUTO_INCREMENT in the database table. When I set the id as 0, it doesn't seem to accept the identifier and hence fails. What should I do in order to write a new entry into the table using this function?

PS : I am able to update the record and the corresponding row in the DB with an existing identifier.

11 replies

stefanhelzle0001
Brainy
November 10, 2022

Leave the id empty or null.

November 10, 2022

I tried setting id as null or "", it still doesn't work. I tried commenting out the id line all together but no luck.

November 10, 2022

If it really is an auto-increment primary key, you don't need to include the id field at all.  Also, is this an action on a button?  docs.appian.com/.../executing_smart_services.html