The preview features allows for downloading the previewed data. But there's a confusion in the underlying code:
first of all, there are 2 ways to indicate that the data is downloadable. The consistency of this mechanism has to be reviewed. Ideally there should be a single operation needed to indicated downloadability.
the downloadable data is that stored in the records variable of the Data object, which may not be the same as the preview data. Again, consistency must be ensured.
The preview features allows for downloading the previewed data. But there's a confusion in the underlying code:
records
variable of theData
object, which may not be the same as the preview data. Again, consistency must be ensured.