Malformed Array Literals

Hi all, I am running into a postgres issue with arrays. I have already looked at this post, tried the suggestion and it did not help: Malformed array literal

In my case I am using a javascript query to call an insert that has to be called a few times. JS is breaking apart the data for the query.

This is the code, stats is the array

for(var i = 0; i < teamKeys.length; i++) {
    	additionalScope: {
    		stats: teams[teamKeys[i]].stats,
                name: teams[teamKeys[i]].teamName,
                teamId: teamKeys[i]
      onSuccess: function() {
        console.log('insert success')

The array seems to be getting stringified or something somewhere as this is what it looks like in the error message:
Screen Shot 2021-11-19 at 4.09.21 PM

Is it not possible to use an array in the additionalScope section of a query trigger?

Hey @jessetgb!

Happy to help here! With a simple example on our end, it seems like you can :thinking:. If you console.log(teams[teamKeys[i]].stats) does it similarly look like its in this format? If you JSON.parse this value does anything change?