How can I make the first column in a table default to sort by date?

  • 1
  • Question
  • Updated 5 years ago
  • Answered
Photo of Michael Marshall

Michael Marshall

  • 362 Points 250 badge 2x thumb

Posted 7 years ago

  • 1
Photo of Anna Wiersema

Anna Wiersema, Alum

  • 10,920 Points 10k badge 2x thumb
In Models, click on the table model, and click Advanced. Then you can choose to sort by Date DESC where "Date" is the name of a date field on the object. This will bring records into this model in Date Order (newest to oldest)

Then, at the field level, you can click on individual fields and check "Allow Ordering" in the properties. Then, when using the page, users will be able to click on that column order to sort by that field.

Does that answer your question?
Photo of John Nelson

John Nelson, Product Manager

  • 3,448 Points 3k badge 2x thumb
Official Response
Hey Mike,

If you want to set a default order for your table you do it in the advanced properties for the model the table is using.

1. With the model selected, open up the Advanced Properties pane.
2. Enter the field you'd like the model's records to be ordered by (it's basically a SOQL ORDER BY clause without the "order by").

Then, if you want your users to be able to change that order at runtime you can set the allow ordering property for the date field.

1. Select the field within the table.
2. Check the Allow Ordering property.

Then you should end up with something like this with the ordering arrows on the table already set to your default order by:

Photo of David Forder

David Forder

  • 2,624 Points 2k badge 2x thumb
Any tips on how I can reverse this order.. ie descending by date field?
Photo of David Forder

David Forder

  • 2,624 Points 2k badge 2x thumb
Scratch that .. worked it out ) DESC
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,968 Points 20k badge 2x thumb
Glad you were able to solve your own problem.  Everyone else on the community is a little tipsy from partying at Dreamforce.  Sorry about the service interruption.. 
Photo of Tami Lust

Tami Lust

  • 5,932 Points 5k badge 2x thumb
Under "Advanced" I do not have a "Field to order records by" check box. Has this option moved for tables?
Photo of Moshe Karmel

Moshe Karmel, Champion

  • 8,686 Points 5k badge 2x thumb
Check on the advanced tab of the model, not the table.
Photo of Tami Lust

Tami Lust

  • 250 Points 250 badge 2x thumb
That was the piece I was missing. Thank you!