Manage row order with a dedicated column

Hello,
I'm trying to set up something pretty basic but I can't get it to work.
In a data table, I have an “order” column that I use to order the list display.
A “Plus” action adds +1: [order] = [order]+1
A “Minus” action decreases by 1 : [order] = [order]-1
So far, so good

I'd like the line that also has the new value of [order] to automatically take the previous value (an inversion).
Order = 4 => Plus action => Order=5
=> the old row with order=5 => order=4
How do you do this?

Thanks

Translated with www.DeepL.com/Translator (free version)

Solved Solved
0 5 153
1 ACCEPTED SOLUTION

You can try the following

Action: Decrement (Set the values....) -> [Order] - 1

Action: Execute Decrement (Execute an action on..) 

  • Table -> Same table
  • Referenced Rows -> FILTER("this table", [Order] = [_THISROW].[Order] + 1)
  • Referenced Action -> Decrement

Action: Increment (Set the values..) -> [Order] + 1

Action: Move Down (Grouped...) -> Execute Decrement, Increment

You can do similar for Move Up grouped action if you want.

View solution in original post

5 REPLIES 5

You can try the following

Action: Decrement (Set the values....) -> [Order] - 1

Action: Execute Decrement (Execute an action on..) 

  • Table -> Same table
  • Referenced Rows -> FILTER("this table", [Order] = [_THISROW].[Order] + 1)
  • Referenced Action -> Decrement

Action: Increment (Set the values..) -> [Order] + 1

Action: Move Down (Grouped...) -> Execute Decrement, Increment

You can do similar for Move Up grouped action if you want.

Whenever I go to implement this sort of manual sorting thing, I always come back to that post and it surprises me that there's so much involved with making it work. 

Each time I always try and rethink about it, is there a way for me to remove one of these actions from the list? Is it really necessary for me to create something like 14 different actions in order for this to work smoothly? 

And every time I come to the same conclusion, yes. 🙂 you do need all of those actions in order for this sort of system to work smoothly. 

 

Only 2 actions with @TeeSee1 solution (but there is no parent/children relation involved)

That's nice !  This is the magic of [_thisrow] value !!
Thanks a lot !

 

Top Labels in this Space