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

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group