# Update dropdown

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fupdate-dropdown%2F59946%3E%5C
**Category:** 🔒 Gradio\
**Created:** [October 26, 2023, 3:19am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fupdate-dropdown%2F59946 "2023-10-26T03:19:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kingzc1](https://avatars.discourse-cdn.com/v4/letter/k/fbc32d/32.png) [@Kingzc1](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FKingzc1)%5C
**Post date:** [October 26, 2023, 3:19am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fupdate-dropdown%2F59946%2F1 "2023-10-26T03:19:04Z")

</div>

Here is the code, which means when the file is uploaded, the dropdown will show the list of xlsx(or csv) file sheet name, but it did not work.  
if anyone could give some advice, thanks a lot!

import openpyxl  
from openpyxl import load\_workbook  
import pandas as pd  
import gradio as gr

def read\_excel(file):  
workbook = load\_workbook(file.name)  
sheets =   
for i in workbook.sheetnames:  
sheets.append(i)  
print(sheets)  
print(type(sheets))  
return gr.update(value=, choices=sheets)

with gr.Blocks() as demo:  
gr.Markdown(  
“”"  
# Hello World!  
Start typing below to see the output.  
“”")  
file\_csv = gr.File(label=“upload”, file\_types=[‘xlsx’,‘csv’])

```
out = gr.Dropdown(multiselect=True)
file_csv.change(read_excel, file_csv, out)

```

if **name** == “ **main** ”:  
demo.launch(debug=True)
