How to populate correct number in Access table AutoNumber field

I have an access table and I’m trying to use the Database Insert activity to publish the final output from the workflow. The primary key in this table is an auto incremented integer. How do I go about updating that value in my workflow?

I tried simply skipping that field or inputting blank or null values thinking that the database would auto-populate with the correct value, but that didn’t work as I got an error.

My next thought is that I’d have to first query the table, select the max value in that field, add 1, then store it as a variable/argument in UiPath, then keep track of the increments myself. This theoretically seems like it would work as long as only 1 robot was performing the process and no one else was adding rows at the same time. Not ideal, but could work.

Is there a better way to go about adding the correct value in a table that has an auto-incrementing value?

1 Like