I have a “newLabels” array variable that I use to store the uuids of selected items from a multi-select element.
Since this reflects a many-to-many relationship in my database (Supabase), I’m now trying to use this array as part of a batch insert on a junction table i.e. I want to insert as many records as there are items in the array, each with key1 : (same value for all records) and key2: (array item value).
I know the binding syntax for this to work needs to be an array of objects but I can’t figure out how to turn my simple array variable into an array of objects where key 1 has the same value for all items and key 2 has the value of the corresponding item in the array variable.
The AI formula helper is not helpful, only producing formulas that don’t work.
I think this is basically the same question as in this thread Create multiple objects from multi-select except I would like a no-code solution. The last reply in that thread indicates that should be possible but doesn’t elaborate on how.
The only idea that comes to mind right now is to use a for loop action in a workflow through the array and create a new one with the proper formatting.
Yeah my solution was also to use JS. FYI on the top left of the formula editor you can change it to an actual JS editor, that should solve your arrow function issue!