Export table "as displayed"

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.

Not yet, but we plan to fix this in our new Table component slated to launch by the start of Q3!

What is your current issue? I wonder if there’s a workaround we can try in the meantime

I want to be able to export the table "as-is" into the CSV.

It means that I want to preserve all of the custom mapping of the displayed column values, including the names of the columns. Right now it just doesn't work.

Ooh, gotcha. Happy to help with that :slight_smile: How are you currently exporting your table? With the save button, a standalone button, a JS query, etc? Is "Download Raw Data" toggled on or off?

Would love a fix for this! The new table feature still doesn't solve this

1 Like

@victoria I had expected the Excel format to preserve cell/column colors (background at least) but exporting in that format simply opens Excel and parses the data.
How is that different from csv ?

One way around it would be to render in HTML (with color style tags, a tag for links,...), copy to clipboard, and then paste manually in Excel - Excel indeed recognizes html and nicely parses with formatting.
But... serializing to HTML requires a lot of JS coding, so I was hoping for a native way.

What's your thoughts ?