Add Item to Array

Hey all!

I have a scenario where there is a column in my supabase database with type “uuid” and set to an array. I need to click a button and add uuids generated from a dropdown to the array. I have the default value of the array column set to empty square brackets. So I should she able to just add items. However everytime I add a new item, it just overwrites the old item. I actually had this working at one point but accidentally cleared the formula and now I can’t get it working again to save my life.

Can anyone offer their insight? Thanks!

I think you might be better off with splitting the array into an “intermediary table” using arrays in supabase is not so efficient if you want to query the IDs.

If you really want to use arrays, I think you need to UPDATE the array with the whole new array, so for example, you’re appending “apples” to [“pears”,”bananas”] you gotta do an Update Workflow Action updating your array by sending [“pears”,”bananas”,”apples”].

1 Like

Thank you for that. That’s something I thought about, but given I “somehow” accomplished this by only adding the single item I’m going to hold out hope until all hope is lost.