Data source sorting

The sort order of the data source (on device storage) is not as per the sequence of records created. Is there a way to ensure that the data source is sorted according to the order of record creation?

Add a createdDate field to your data and set it to the current time/date when you create it. Then sort it in ascending order when you display it. Without a date field you might could do it by the record ID and sort ascending on that if it’s something that auto increments. It all really just depends on your data.

Edit: just saw where you mentioned it was on device storage. I don’t think it uses an auto incrementing ID so you’d almost have to use the date field idea.

1 Like