✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🧬 Learn how to build RNA-Seq data apps with Python & Dash. Register for the May 20 Webinar!

Downloading raw data with customized name

I’m trying to download data as in the example Download raw data , but I’m trying to make the name change according to selections i’ve made.

Any ideas? Thanks!

I’ve tried the following:
@app.callback(Output(‘download-link’, ‘children’),
[Input(‘my-date-picker-single’, ‘date’), Input(‘table’,‘rows’)])
def update_string(date, rows):
date = plt.get_data_date(date)
date_string = date.strftime(’%Y%m%d’)
dff = pd.DataFrame(rows)
csv_string = dff.to_csv(index=False, encoding=‘utf-8’)
csv_string = “data:text/csv;charset=utf-8,” + urllib.parse.quote(csv_string)
return {‘download’: ‘IN_ {}_{}.csv’.format(‘CHIP’, date_string),
‘href’ : csv_string}
but it breaks thw whole app :frowning: