Hi everyone, I am trying to add two small icons in the header of the stacks of the kanban so that I can move the column left or right. (there is a “sortable” switch, but it doesn’t seems to add this capacity)
So I added two icons in the header and added a workflow on click to the icons so that the sort_index of the columns are changed accordingly. I first store the ids of the a variable
You probably change the same record twice every time you run the workflow and since yo are referring only to element 1 and 2 (index 0 and 1) you always finish with the same value This is my assumption as you did not share the formula for 'id" of the record.
I don’t think your method will work anyhow. Position of columns in Kanban depends on Stacks variable which is array of objects (example is based on Kanban fake data):
What I’m doing I’manipulating this variable to move the position of the objects within the array with a simple JavaScript (as a Formula so it can be reused)
(This is for right Button - for the left Button it should be - 1).
And that’s it. If you want to save the order into the database you can make a workflow for that and bind it to the Button - for example: save the view - this will limit api calls to Supabase.
There are probably other methods but I hope you catch the idea.
Thank you Dominic for your suggestion. I realised it was a RLS problem at the Supabase level. What I didn’t expect is that the operation was forbidden on the database but Weweb reported a successful operation in the log.
I didn’t try your suggestion yet but it looks neater than mine.