Table sorting by types 'User Email' and 'Date' are incorect

I have a table of aggregated data and have several columns that all sort by mapped value. I have two columns, one of type 'User Email' and one of type 'Date' that both sort incorrectly. However, I know the mapped values are correct because when I change both columns to type 'Text', they sort the data correctly. I suspect the problem is stemming from how Retool parses raw data into certain data types. For the 'User Email' column it's find to use type 'Text', however I would prefer to use 'User Email'. And my 'Date' column cannot be raw text as it would very difficulty for users to read the table. Any solutions or ideas what could be going wrong?

Screenshot from 2022-08-04 13-21-08
Screenshot from 2022-08-04 13-19-21
Screenshot from 2022-08-04 13-19-02

Hey Francesca,

This is a bug that slipped by on our part. We have aimed to address this during Q4, and I've just checked with our dev team to confirm. The only solution for sorting here (with the bug standing) is to not have any null values in your dataset. Just throwing darts, if your data is intended for nulls, could you temporarily substitute them with garbage e.g. 01/01/2001, to be converted back to nulls once this bug is squashed from our side?

Hey Amanda!
I'm seeing the same bug, but I don't have any nulls in my dataset.
I was able to reproduce it with the simple data below

  	added_time: 1665781003594,
  	id: "a",
  	added_time: 1666020338873,
  	id: "b",
  	added_time: 1665687940099,
  	id: "c",

This is how my column is configured and you can see from the screenshot that it is not sorting right tough.

Any workarounds for this?

Hey @fnfilho
This is really bizarre (with a bug filed), but does this work for you?
{{ moment(self).format() || '' }}

Adding .format() at the end did the trick.

Captura de Tela 2022-10-27 às 21.00.16

1 Like

Replying to confirm that @Amanda's workaround worked for me as written, without adding @fnfilho's unix formatting.

Edit: The behavior of rows with a Null for the time column is that their time value is set at the current wall clock date and time.