Bulk update with primary key is creating multiple records in database

I have been attempting to update a table using the bulk update with primary key function. For some reason, everytime I try to make changes to record, I get multiple rows added to the table. Most recently I had five rows added to the table. Some are for other customers, some are for no customer at all as they are blank.

This is how I have the bulk update set up:

I am using the following script to trigger the update as well as refreshing the table to show the updates completed.

query66.trigger({
  onSuccess: query 64.trigger({
    onSuccess: utils.confetti()
  })
});

I am really at a complete loss as to what would be causing this. Any help would be much appreciated.

1 Like

Hi @tomm Nothing is jumping out with this query :thinking: I think we'll have to see examples of data that is being passed in to this query & compare it with data in your table.

The only other thing I can think of is making sure you have a primary key set on the table configuration, ensuring there are no duplicate primary keys, and enabling this setting on the table if needed for your use case:

Hi @Tess,

This issue was actually being caused by me. I was putting in query that were supposed to be run if an event was successful, and I ended up putting them in too many places. I have gone back through and cleaned up queries some and it looks like the problem has been solved. Thanks for the response though.

1 Like