# Sort ui\_table data by a datetime programatically at the start

**URL:** <https://discourse.nodered.org/t/sort-ui-table-data-by-a-datetime-programatically-at-the-start/33044>\
**Category:** Dashboard\
**Created:** [18 September 2020 13:27 UTC](https://discourse.nodered.org/t/sort-ui-table-data-by-a-datetime-programatically-at-the-start/33044 "2020-09-18T13:27:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JVergara](https://avatars.discourse-cdn.com/v4/letter/j/85e7bf/32.png) [@JVergara](https://discourse.nodered.org/u/JVergara)\
**Post date:** [18 September 2020 13:27 UTC](https://discourse.nodered.org/t/sort-ui-table-data-by-a-datetime-programatically-at-the-start/33044/1 "2020-09-18T13:27:44Z")

</div>

Hello together,

I am now a little block with this object. I want to sort by timestamp all the data of my ui\_table, but I want to do at the initial moment ( when loaded). I have found this after Tabulator documentation:

> **[Tabulator - Interactive JavaScript Tables](http://tabulator.info/docs/4.7/sort)**
>
> Create interactive data tables in seconds with Tabulator. A lightweight, fully featured JavaScript table generation library.

```auto
"initialSort": [
            {
                "column": "Timestamp",
                "dir": "asc",
                "sorter": "datetime",
                "sorterParams": {
                    "format": "YYYY/MM/DD HH:mm:ss",
                    "alignEmptyValues": "bottom"
                }
            }
        ],

```

But I have added in my ui\_control in the json but this don't work, this don't work properly. The older item its at the first row, and I would like to have the newer item at the first row.  
Thanks at all.

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [18 September 2020 19:36 UTC](https://discourse.nodered.org/t/sort-ui-table-data-by-a-datetime-programatically-at-the-start/33044/2 "2020-09-18T19:36:14Z")

</div>

I havent worked with ui\_table recently but have you tried replacing

```auto
"dir": "asc", with "dir": "desc",

```

---

<div class="post-metadata">

**Author:** ![JVergara](https://avatars.discourse-cdn.com/v4/letter/j/85e7bf/32.png) [@JVergara](https://discourse.nodered.org/u/JVergara)\
**Post date:** [28 September 2020 08:20 UTC](https://discourse.nodered.org/t/sort-ui-table-data-by-a-datetime-programatically-at-the-start/33044/3 "2020-09-28T08:20:33Z")

</div>

yes I have test it too with "desc", but that don't work yet.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [28 October 2020 08:20 UTC](https://discourse.nodered.org/t/sort-ui-table-data-by-a-datetime-programatically-at-the-start/33044/4 "2020-10-28T08:20:41Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
