Swap the order of items within a list

I have a problem with something that I can't find how to do in Flutterflow.

I'm developing a feature in an application, which consists of two buttons (up and down) that will allow the user to change the order of elements within a list (in this case, they are the order of missions within a game).

The logical solution found for this was to create an "order" field within the Missions document, and use this field as the order in the query that pulls the filtered missions collection for the event in question.

However, when adding the collection query to find the value of the "order" field of the item that is the exchange recipient, the chain of actions stops working. It has already been verified that the problem is in this first query. Because, when removed, the chain of actions works normally again.

Can anyone help me find a solution to implement this feature in Flutterflow?

1
3 replies