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