# How to sort the data displayed by UI\_Tablet by the value of a column?

**URL:** <https://discourse.nodered.org/t/how-to-sort-the-data-displayed-by-ui-tablet-by-the-value-of-a-column/50664>\
**Category:** Dashboard\
**Created:** [6 September 2021 09:36 UTC](https://discourse.nodered.org/t/how-to-sort-the-data-displayed-by-ui-tablet-by-the-value-of-a-column/50664 "2021-09-06T09:36:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![carflomi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/carflomi/32/45646_2.png) [@carflomi](https://discourse.nodered.org/u/carflomi)\
**Post date:** [6 September 2021 09:36 UTC](https://discourse.nodered.org/t/how-to-sort-the-data-displayed-by-ui-tablet-by-the-value-of-a-column/50664/1 "2021-09-06T09:36:45Z")

</div>

hello.  
Let's see if you can help me.  
I have a ui\_tablet node with 3 columns  
 ![Table](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/8/e80d922a6762304252ec791a1562cfc2db440a70.jpeg)

Do you know how to sort by the Timestamp column **(showing the newest record at the top**)?

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [6 September 2021 11:07 UTC](https://discourse.nodered.org/t/how-to-sort-the-data-displayed-by-ui-tablet-by-the-value-of-a-column/50664/2 "2021-09-06T11:07:56Z")

</div>

Have you tried sorting/ordering the array by the timestamp property  
in a change node using JSONata, before the ui node.  
`$$.payload^(timestamp)`

> **[Path Operators · JSONata](https://docs.jsonata.org/path-operators#---order-by)**
>
> The path operators underpin the declarative nature of the map/filter/reduce processing model in JSONata.

---

<div class="post-metadata">

**Author:** ![Christian-Me](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/christian-me/32/10774_2.png) [@Christian-Me](https://discourse.nodered.org/u/Christian-Me)\
**Post date:** [6 September 2021 12:31 UTC](https://discourse.nodered.org/t/how-to-sort-the-data-displayed-by-ui-tablet-by-the-value-of-a-column/50664/3 "2021-09-06T12:31:27Z")

</div>

You can send sorted data to ui-table.  
But if you like to use the sorting feature in the column headers you have to dig in deeper:

> [@Ui-table date sort](https://discourse.nodered.org/t/ui-table-date-sort/21685):
>
> Anyone know of a neat trick to get a ui-table to do sorting by date, rather than standard numeric sort? Thanks

This should give you a starting point

You have to use an inject node to send a message on start with the config json in `msg.ui_control`. The `field` Parameter has to match your property definition (`timestamp`). You only have to send the parameters you like to change. (More information in the examples)

---

<div class="post-metadata">

**Author:** ![carflomi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/carflomi/32/45646_2.png) [@carflomi](https://discourse.nodered.org/u/carflomi)\
**Post date:** [7 September 2021 06:51 UTC](https://discourse.nodered.org/t/how-to-sort-the-data-displayed-by-ui-tablet-by-the-value-of-a-column/50664/4 "2021-09-07T06:51:41Z")

</div>

Hello, Thanks, But I think that this is not the solution, the information is already sorted in the table, it is only necessary to get the most recent event at the top of the column.

---

<div class="post-metadata">

**Author:** ![carflomi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/carflomi/32/45646_2.png) [@carflomi](https://discourse.nodered.org/u/carflomi)\
**Post date:** [7 September 2021 06:53 UTC](https://discourse.nodered.org/t/how-to-sort-the-data-displayed-by-ui-tablet-by-the-value-of-a-column/50664/5 "2021-09-07T06:53:30Z")

</div>

Thanks, I study your indications, to see if they help me to obtain my objective.

---

<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:** [7 October 2021 06:54 UTC](https://discourse.nodered.org/t/how-to-sort-the-data-displayed-by-ui-tablet-by-the-value-of-a-column/50664/6 "2021-10-07T06:54:07Z")

</div>

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