> For the complete documentation index, see [llms.txt](https://ezcodeco.gitbook.io/sortable-rg/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ezcodeco.gitbook.io/sortable-rg/initial-order-feature.md).

# Initial Order - Feature

How to use the initial order feature.

### Example of implementation

The main logic is this:&#x20;

On page X you reorder things&#x20;

On page Y you see the results<br>

### **Setup on page X**&#x20;

On page X we don't need to setup the Initial Order field, so, leave it empty. \
We need to setup the logic of saving the new order in DataBase. \
In our demo, we've used a separate DataBase where the new order is saved. \
Basically it is 1 field only and 1 thing in DB, no need to save it in every thing from your database that you are use for repeating group. See the screenshot below, we use the DB Analytics for that, and observe that there's only 1 thing that we are using to save it.&#x20;

![](https://3633764263-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MMGEs9zVdlvM_NNMEkP%2F-MTfQgaoAIKt_tiZ-m74%2F-MTfR2VI9KIsmBMcdZFD%2FScreenshot%202021-02-16%20at%2017.13.59.png?alt=media\&token=42298930-65d0-4553-bdbc-5c2cba787712)

I repeat, you don't have to save this order in every thing from your repeating group, make a separate database and save it there like in our demo.

Next, to save it, use the plugin's state **New Order**. \
Make change to your database "Analytics" (or whatever name you set), when the event **Drag Ended** is triggered.&#x20;

Example from our demo:&#x20;

![](https://3633764263-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MMGEs9zVdlvM_NNMEkP%2F-MTfQgaoAIKt_tiZ-m74%2F-MTfR9uQ9NZTEMoWyC7H%2FScreenshot%202021-02-16%20at%2017.17.33.png?alt=media\&token=60320547-5f0b-4df8-a326-357b11b0a984)

### **Setup on page Y**&#x20;

On this page, is important that you are using the same database for you repeating group as in page X to avoid errors. \
In the field **Initial order**, from the plugin element, set the thing from Analytics database that we were changed on page X.&#x20;

![](https://3633764263-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MMGEs9zVdlvM_NNMEkP%2F-MTfQgaoAIKt_tiZ-m74%2F-MTfRIS_U3iSLKUVqzFd%2FScreenshot%202021-02-16%20at%2017.19.35.png?alt=media\&token=44a9b1de-523e-46e3-9adb-89a77e2bd96c)
