cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Why is the whole list not displayed in dbutil.widgets.multiselect?

Deiry
New Contributor III

I have been studying the Apache Spark in Databricks Academy and I don't understand why the whole list is nos displayed?

Creation of widgets:

dbutils.widgets.text("name", "Brickster", "Name")
dbutils.widgets.multiselect("colors","orange", ["orange", "red", "orange", "black", "blue"], "Traffic Sources")

And display it

name = dbutils.widgets.get("name")
colors = dbutils.widgets.get("colors").split(",")
 
html = "<div>Hi {}! Select your color preference.</div>".format(name)
for c in colors:
    html += """<label for="{}" style="color:{}"><input type="radio"> {}</label><br>""".format(c, c, c)
 
displayHTML(html)

Result

image 

It should be with orange, red, blank...

0 REPLIES 0
Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!