Data Table Export with linked rows

For columns with linked rows, include the same descriptive value shown in the UI in the .csv file that downloads. The linked Row IDs have zero relevance for end users.

I’d like to suggest a toggle. Not all downloaders are end-users. Some, like me, are developers, and we’re moving the data to an actual database, where the row ids are actually relevant.

2 Likes

i’m with @p.colbert.

sometimes i’ll do something like…

import anvil.media
import pandas as pd

@anvil.server.callable
def get_data_as_list_of_dicts():
  table_file = app_tables.my_table.search().to_csv()
  with anvil.media.TempFile(table_file) as file:
    df = pd.read_csv(file)
  return df.to_dict('records')

this allows me to send data to the client as a list of dicts.
and I have all the row ids for the linked rows which is ideal… and exactly what i’d expect