Sortable List
Creates a sortable list with API data
π The Tag
Drag and drop your list items and change their order! Create a sortable list to enable this behavior in a list inside your app.
π Where to add the tag: A container element.
[sortable]βοΈ Backend setup
In order to sync the list reordering in the backend, the API endpoint needs to receive an API request every time a user changes the order of the items. Therefore, some backend logic is needed to update the database accordingly.
To get started quickly, we created a Xano snippet that will generate the API endpoints needed to handle the reordering, together with a database with some sample data. We recommend installing it in your Xano environment. You can also develop your own backend from scratch (you'll need this in case you're using a different tool). Note that this will require some advanced technical skills.
π¨ Design setup
Add the [sortable] tag in the corresponding container element. When connecting the container to API data, a sortable list will be created in the app.

We created a sample design you can check out. Feel free to duplicate and customize it.
βοΈ API requests setup
In order for this feature to work, weβll need (at least) the following API requests:
A
GETrequest to obtain the corresponding list data.A
PUT/PATCHrequest that will be triggered whenever a user reorders the list. This request will send the necessary information so the list is reordered in the backend.
PUT request
PUT requestIn case you use our Xano snippet, youβll need to setup the PUT request in the way explained below.
Request URL
It will be the one that communicates with the corresponding PUT endpoint in the backend. In this example, the ${tasks_id} variable will take the value of the record ID, so youβll need to use this name in the GET requestβs Selected Data section for the record ID data.
Note that you can use a different variable name, as long as the names in Selected Data and in the PUT request URL match.
Request body
Use the following request JSON body to target the Xano endpoint.
GET request
GET requestFinally, you'll need a GET request to obtain the data for the list items. Remember to select the ID of the list items, and give it the same name as the variable in the PUT request URL.
π Data binding setup
Once the API requests are created, itβs time to bind the properties of the sortable list to the corresponding data items. Bind the following properties as shown below.
Container
Bind this property to the list data item that references the API list.

Sort / Swipe to delete ID
Bind this property to the data item that references the list record ID. It should be in the same request that was bound to the Container property.

Remote action (sort)
Bind this property to the request that is triggered upon list reordering. In case you use our Xano snippet, this will be the PUT request created previously. Choose No action for the On Success / On error actions, unless you want to implement a different behavior.

π² Test in Bravo Vision
Thatβs it! Open your app in Bravo Vision to test the sortable list. The sortable list works by long pressing an item in the list and dragging it to a new position.
Last updated
Was this helpful?
