# Dynamic Drop down option

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdynamic-drop-down-option%2F66692%3E%5C
**Category:** 🔒 Gradio\
**Created:** [December 22, 2023, 5:46am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdynamic-drop-down-option%2F66692 "2023-12-22T05:46:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![srjn](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@srjn](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fsrjn)%5C
**Post date:** [December 22, 2023, 5:46am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdynamic-drop-down-option%2F66692%2F1 "2023-12-22T05:46:09Z")

</div>

Hi everyone,  
In the application I’m trying to build I want to have a dropdown which loads one of the column from csv,since this csv file keeps getting updated, I want to make this dropdown dynamic such that everytime I click a button the dropdown options should get updated,I am facing issue with trying to make this work, please refer the below attached dummy code, interface and error message.

Dummy code:  
def load\_data():  
values=pd.read\_csv(“versions.csv”,encoding=“UTF-8”)[“version”].tolist()  
return values  
with gr.Blocks() as demo:  
Op=gr.Dropdown(label=“List the data from csv”)  
Refresh=gr.Button(“Refresh the drop down data”)  
Refresh.click(load\_data,outputs=Op)

demo.launch()

Dummy Interface:

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/3X/3/3/33af95b298292f2f5224f54c60984d948d62728e.png)

Error:  
“UserWarning: The value passed into gr.Dropdown() is not in the list of choices. Please update the list of choices to include: [‘FINAL’, ‘LUCY’, ‘COD’, ‘TRUX’, ‘corsa’] or set allow\_custom\_value=True.”

if I set “set allow\_custom\_value=True” Dropdown will get converted to Textbox which will be a issue as I need dropdown choices for upstream processes.
