> For the complete documentation index, see [llms.txt](https://docs.avonnicomponents.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avonnicomponents.com/flow/tutorials/components/list/how-to-reorder-items-and-update-records.md).

# How to Reorder Items and Update Records

## Overview

Imagine a to-do list app where users can easily rearrange tasks to prioritize their day. The [Avonni List](/flow/flow-components/list.md) component makes this possible. Users can drag and drop tasks - or any other items - to change their order, and the app automatically updates the task order in the background. This provides a more intuitive and flexible way for users to manage their to-do lists.

<figure><img src="/files/SEfQn6JUFWvXBRduwtQq" alt=""><figcaption></figcaption></figure>

## **Step-by-Step Guide**

### **Step 1: Configure the Avonni List**

* Set up your Avonni List to display the data you need using the Query Data Source.
* In the List settings, choose the field that stores the order information (e.g., "Order\_\_c") as the "Order By" field. This is crucial for the reorder functionality to work.

<figure><img src="/files/Fx9kMnU8ExQbk1P79VQr" alt=""><figcaption></figcaption></figure>

### Step 2: Activate the reorder capability on the list

By default, the list doesn't allow reordering. To let users rearrange items:

1. Find the "Sort" section in the list settings.
2. Turn on the "Sortable" option.
3. Now, users can drag and drop items to change their order.

<figure><img src="/files/Ow3VXt03JdNHzVSD7Nb8" alt=""><figcaption></figcaption></figure>

### **Step 3: Add the Reorder Interaction**

* Under the "Interactions" section, find the "Reorder" event.
* Add an "Update Records Order" interaction to this event. This will automatically update the order field in your records when you drag and drop items to rearrange them in the list.

<figure><img src="/files/DaMQXRIZYtGkgUAdCLA7" alt=""><figcaption></figcaption></figure>

### **Step 4: Refresh the List**

* Add a "Refresh query" interaction to ensure the list visually reflects the new order after reordering.
* Set this interaction to trigger "After" the "Update Records Order" interaction.

**And that's it!** You've now enabled the powerful drag-and-drop reordering feature in your Avonni List, which automatically updates records.

**Key Points:**

* Make sure your data has a field representing the order (e.g., "Order\_\_c").
* Set this field as the "Order By" field in the List settings.
* Use the "Update Records Order" interaction on the "Reorder" event.
* After reordering, add a "Refresh query" interaction to update the list visually.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.avonnicomponents.com/flow/tutorials/components/list/how-to-reorder-items-and-update-records.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
