Invalid ID values in .changesArray for Bulk update via primary key

I have a very basic Event handler for updates to a table. On Save the event handler calls updateRate_DB.

However the .changesArray has string values for c5ccb instead of an id value of the primary key (numeric). I've tried refreshing the app which seems to help when I hit inexplicable behaviour but no luck so far. Any ideas @ retool team?

Screenshot 2023-11-29 at 06.44.18


@Kabirdas Just tagging you as you've been so helpful in the past. Ever seen anything like this?
My only thought is to delete the table and try again. Too weird :face_with_spiral_eyes:

{{rolesRates.changesetArray}} [0] = {"c5ccb": 0, "rate", 41}
The query populating the FE table rolesRates is very basic:
SELECT as id, fd_roles.role, fd_roles.rate FROM fd_roles


Hey @nickaus! Looking at the screenshots, the changesetArray appears to have numeric types for the values of c5ccb in each object. String values are generally wrapped in quotes (and purple/pink vs green). Are you getting an error when trying to update? Do you see those values explicitly as a string elsewhere?

changeset with both numeric values and strings for comparison:
Screenshot 2023-12-12 at 11.50.27 AM

Hi @joeBumbaca,
Thanks for your reply.

I do get an error when I attempt to save the changes (as there is no id in the .changesArray).

updateRate_DB failed (0.247s):Primary key id is not present in the supplied array

I have no idea what c5ccb is. Could it be something Retool-internal?

I have this in the .changesArray (for a single update):

c5ccb 0
rate 201

What I expect to see is:

id 6
rate 201

id is the pk on the table, and is set as an int4. You can see the id (6) in the screenshots below. So basically, I'm getting this c5ccb instead of id. So of course 'Bulk update via a primary key' fails.

I have encountered the same issue on another table - but need to go back and find it (working on numerous apps atm).

Screenshots below highlighting the above:

Front end table. Basic SELECT * from single table.

.changesArray after making a change to a 'Rate'

DB table (showing pk details)

I'll try to find the other case where this is happening.

I have plenty of Save actions using 'Bulk update via a primary key' elsewhere in other apps.

My only thought really is to delete the table and see if it goes away? :thinking: