> For the complete documentation index, see [llms.txt](https://community-test.logicnets.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://community-test.logicnets.com/release-9/platform-documentation/process-node-parts/sort-collection.md).

# Sort Collection

## Description

The sort collection part allows application users to sort a collection.

## Use

The sort collection part can be used for sorting a collection in ascending or descending oder. The result of this sort can also be put into an new data object. The sort\_collection part is located in process nodes under *collections* and then *sort collection* on the *Element* tab.

## Editor Fields

| Field            | Type / Options     | <p>Optional/<br>Mandatory</p> | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                    |                                                                                                                                                          |      |                                                                                                                          |
| ---------------- | ------------------ | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------------------------------------------------------------------------ |
| Input            | data object        | M                             | This is the name of the collection you want to sort.                                                                                                                                                                                                                                                                                                                                                                                                           |                                                                                                                                                          |      |                                                                                                                          |
| Item type        | Simple\|Complex    | M                             | <p><strong>Simple:</strong> Select this option if the items in the collection are number, text, or date types.<br><strong>Complex:</strong> Select this option if the items in the collection are tables.<br>For complex item types, it is possible to specify multiple fields for sorting. If sorting two items with the same value, the system will compare the next field. If a field is missing the system will treat the field as having a nil value.</p> |                                                                                                                                                          |      |                                                                                                                          |
| Output           | data object        | M                             | This is the name of the resulting collection that contains the sorted collection. This can also be the same as the input data object.                                                                                                                                                                                                                                                                                                                          |                                                                                                                                                          |      |                                                                                                                          |
| Data type        | text\|number\|date | C                             | This is where you seelct the data type of the sorting column.                                                                                                                                                                                                                                                                                                                                                                                                  |                                                                                                                                                          |      |                                                                                                                          |
| Output direction | asc\|desc          | C                             | This option allows you to select the sorting direction.                                                                                                                                                                                                                                                                                                                                                                                                        |                                                                                                                                                          |      |                                                                                                                          |
| Date format      | text               | C                             | If the data type is date, this field appears and allows you to specify the format of the date field.                                                                                                                                                                                                                                                                                                                                                           |                                                                                                                                                          |      |                                                                                                                          |
| Order by         | table              | C                             | <p>If item type is complex:<br><strong>Order by</strong>: This is the name of the collection column on which the system will sort.<br><strong>Direction:</strong> This option allows you to select the sort direction -- the options are asc                                                                                                                                                                                                                   | desc, and the default is asc.<br><strong>Data type</strong>: This option is where you select the data type of the sorting column. The choices are number | text | date.<br><strong>Date format</strong>: If data type is date, this is where you specify the format of the date field.</p> |

## Example

Please download and import the following [example project](/release-9/example-gallery/example-projects-for-parts/sort-collection-example-project.md) in your workspace.

This example shows the usage of the sort collection part for both simple and complex item types.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://community-test.logicnets.com/release-9/platform-documentation/process-node-parts/sort-collection.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
