cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
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
Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.