# Audit Log Table default sort

**URL:** <https://forum.inductiveautomation.com/t/audit-log-table-default-sort/18804>\
**Category:** Ignition\
**Created:** [July 12, 2018, 3:03pm UTC](https://forum.inductiveautomation.com/t/audit-log-table-default-sort/18804 "2018-07-12T15:03:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![harold.bruulsema](https://avatars.discourse-cdn.com/v4/letter/h/e79b87/32.png) [@harold.bruulsema](https://forum.inductiveautomation.com/u/harold.bruulsema)\
**Post date:** [July 12, 2018, 3:03pm UTC](https://forum.inductiveautomation.com/t/audit-log-table-default-sort/18804/1 "2018-07-12T15:03:57Z")

</div>

I have a window, with a Table object, to show recent events in the Audit Log, and a Date Range object, to allow selecting the date range to view.

The Data property is bound to Other-\> Functions

The Binding Function is Audit Log  
Start Date is bound to …Date Range.startDate, End Date is bound to …Date Range.endDate.

It works perfectly, except I would like it to default to sorted by Timestamp Descending. I can click on the column header for Timestamp, that cycles through Ascending/Descending/Nothing as expected, but each time I run the project, I have to click on the header to make is sort the way I want to.  
Just a little nuisance, but is there a (simple?) way I can get this table to default sort by Timestamp Descending?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [July 12, 2018, 3:14pm UTC](https://forum.inductiveautomation.com/t/audit-log-table-default-sort/18804/2 "2018-07-12T15:14:01Z")

</div>

Add a custom property (type: dataset) to the table component, and copy your function binding to it. Then on the actual _data_ property of your table, switch to an expression binding using [`sortDataset`](https://docs.inductiveautomation.com/display/DOC79/sortDataset); something like this:  
`sortDataset({{Root Container.Table.functionDataset}, "name of timestamp column", false)`

---

<div class="post-metadata">

**Author:** ![harold.bruulsema](https://avatars.discourse-cdn.com/v4/letter/h/e79b87/32.png) [@harold.bruulsema](https://forum.inductiveautomation.com/u/harold.bruulsema)\
**Post date:** [July 12, 2018, 3:39pm UTC](https://forum.inductiveautomation.com/t/audit-log-table-default-sort/18804/3 "2018-07-12T15:39:33Z")

</div>

Perfect, that works, thanks!
