Export table "as displayed"

Is there any way to export a table's data as it is displayed in the table? Same columns included, in the same order, ideally with the same column names and mappings if possible.

Thank you!

1 Like

Hey @byron!

Great question, short answer here is not natively at the moment. You can use a JS transformer rather than the built-in column mappers to customize your table data before you pass it to your table component and export the data from there. Do you think this something like this could work for your use case here?

1 Like

Thanks Chris for the reply. I feel like the default behavior of the download button should be "download what i see in the table". Perhaps you can discuss it with the rest of the product team?

To answer your question, it's far from ideal to have to transform my own data. Putting it in the right order, selecting which columns to show, and applying the mappings all a second time would be...pretty painful.

If you don't want to break any existing functionality, a separate table property for "displayData" would be just as good.

Thanks a lot!

2 Likes

Hey @byron — I definitely agree, this makes a lot of sense and would be a great feature. We currently have a team working on reworking existing components and will make sure to pass this along in an internal feature request to the team working on a table rework so hopefully we will be able to do this natively in the future!

Hi @Chris-Thompson and @byron, isn't there a property called displayedData in table components?

I've been using it since last week. The only thing I know not included in this property is the custom column hence I have this transformer in my export event:
displayed_data_export

Is this what you are looking for @byron ?

1 Like

For me that property does not match the show/hide settings nor the ordering of what I see in my table. Thanks for the suggestion though,

Didn't work for me either @jocen - just exported all the columns, not just the visible ones...

If the table's "Download raw data" toggle is enabled, the CSV export will be exactly equal to the table's data property converted to CSV format.

If "Download raw data" is disabled, the table data will download with:

  • Mappers applied
  • Current filters applied
  • Modified column titles (i.e. customer_name edited to -> Customer Name)

It will not match:

  • Columns order horizontally (it will match the order as input to the table originally)
  • Rows in sorted orders (it will match the order as input to the table originally)
  • Pending recordUpdates values

Download raw data OFF is now the default setting for new table components that are created.

As for the table's displayedData property: that actually only accounts for filters, not mappers, hidden/shown columns, or any other updates to how the raw data is displayed. I believe this property name pre-dates the existence of column mappers, and that kind of thing is very difficult to safely migrate the behavior of inside existing apps.

1 Like

Following up on this - it would be great if the export of displayedData actually exports the as is displayed data without having to do mappings (which are already done). Any chance this could be looked into again? There is no way to currently export to xlsx of a table that has had any mappings and/or hide columns. Would greatly help our workflow. Ty.

ps - I'm aware of the download arrow in the bottom right which sends it to csv, but you don't get any control over the naming of the file nor can you export to excel format.

3 Likes

@alex-w @Chris-Thompson It would be really nice to have it like @griffxbio says. We need to have programmatic access to the ACTUAL displayed data (with mappings, as we see in the table) the same way we have to raw data and filtered data.

1 Like

Hi @alex-w - to your first point about having "download raw data" off... it doesn't export the table "as is seen in the browser". The order of columns is not preserved when clicking download and you if you don't set {{self}} inside "values" for certain columns, those columns are entirely blank (despite the column header existing). Seems like the table export needs some TLC owing to these two on-going issues. Again, even if I make an "export to csv" button, it only outputs the raw data (no different to if using the table button with "download raw data toggled off").

  • preserving column orders upon export
  • exporting both raw and mapped data (to csv/excel) in both the download button in the table and another button action altogether.
  • ensuring mapped columns actually export the data in the columns and not blank columns

Was there any movement on the table situation Since Feb 21? Thank you.

Hi @griffxbio, doesn't look like there's been movement, but I just checked in!

In the meantime, are you running into a similar issue as this user / would the solutions I tried work for you? They are more related to this specific user's setup (using a multiselect to dynamically show columns), so maybe not, but I assume the underlying bug is the same. Let me know!

http://community.retool.com/t/downloaded-csv-data-shows-empty-data-for-column/10520/8

Interested in this as well!!

Hi, I can confirm that the download csv button doesn't export the table as you can see.
I have many columns mapped on the ID of the record, I don't want the item ID (the foreign PK) downloaded obviously, I would like to download the CSV with the item description...
Thank you!

Hey @techaf! How are you currently downloading this csv? Are you using the built in table download button?

Hi @victoria ! Yes I am using the built in button. I have tried also with the custom button calling the export js function but it is the same. It downloads a csv with the ID of the entity and not the description as seen.
Thank you for the support!

TABLE:
category_seen_on_table

DOWNLOADED CSV:
downloaded_CSV

Have a nice day!

Hey @techaf! I haven't been able to reproduce this issue. Would it be alright if I stepped into your app to take a look? If so, would be be able to send me a link to your app to my direct email:

victoria.campbell@retool-ba9e93d5caa4.intercom-mail.com

Once we solve it, I'll post the solution on this thread! :slight_smile:

ok thank you !

Hey @victoria! Any news on this issue? I am having the same issue with mappers not being applied for enum kind of values as @techaf mentioned above.