Download all table contents to a .csv

app_tables.my_table.search().to_csv()
will get you the csv
though if you need to process the csv then you’ll need to iterate through the rows and write each row as you’ve already suggested.

You can create the csv on the server and send a media object to the client.
But there’s no builtin component that will accomplish this.

So you’d probably end up doing something like

def button_click(self, **event_args):
  csv = anvil.server.call('get_csv')
  download(csv)

3 Likes