# Dynamic Sorting

## Overview

Dynamic sorting allows you to retrieve data in a specified order based on user-defined parameters. This feature is especially useful for building responsive APIs where sorting criteria can change depending on user preferences or application needs.

## Using Dynamic Sorting

In the sorting window choose the "dynamic sorting" tab

<figure><img src="https://1803924624-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkjtTl1rn3hJ3jyoJt6ty%2Fuploads%2FOrui17wcACs7xqiqXBXI%2Fimage.png?alt=media&#x26;token=de016743-0d3f-4cea-9145-3c6aacf3659e" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1803924624-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkjtTl1rn3hJ3jyoJt6ty%2Fuploads%2F8dP3utQt3abm21zYxxa5%2Fimage.png?alt=media&#x26;token=8b6b1bcb-66df-4463-b8de-e1b5b8961ac6" alt=""><figcaption></figcaption></figure>

select the column you want to sort by

<figure><img src="https://1803924624-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkjtTl1rn3hJ3jyoJt6ty%2Fuploads%2FY2PdXo6gUH1M0UaRhKvy%2Fimage.png?alt=media&#x26;token=71fbca65-d7ef-48b3-9fb4-e8b96dddc611" alt=""><figcaption></figcaption></figure>

click on the "+" button to add the column

<figure><img src="https://1803924624-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkjtTl1rn3hJ3jyoJt6ty%2Fuploads%2FWIWq4XOCcMkHHRliZLXa%2Fimage.png?alt=media&#x26;token=98c86b0e-bfa5-4149-b795-7b461d724422" alt=""><figcaption></figcaption></figure>

## Testing

Copy the endpoint URL from the top right box on the API page

<figure><img src="https://1803924624-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkjtTl1rn3hJ3jyoJt6ty%2Fuploads%2F16lcZSiyuCTt7pqoVPPv%2Fimage.png?alt=media&#x26;token=94a80b3e-c098-45f1-abb8-2f87c98e4543" alt=""><figcaption></figcaption></figure>

Open Postman and then paste the copied endpoint url and hit send

<figure><img src="https://1803924624-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkjtTl1rn3hJ3jyoJt6ty%2Fuploads%2F45xJYf7UjdaAa3f3QuEv%2Fimage.png?alt=media&#x26;token=02526c20-31ec-49a5-986b-7ce5d276d719" alt=""><figcaption></figcaption></figure>

You should get an appropriate response

<figure><img src="https://1803924624-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkjtTl1rn3hJ3jyoJt6ty%2Fuploads%2FDurrX5PLtIgqe73sWiMR%2Fimage.png?alt=media&#x26;token=6d67d08c-7493-4b40-9102-8358016dc827" alt=""><figcaption></figcaption></figure>
