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: 

How to sort widgets in a specific order?

laus
New Contributor III

I'd like to have a couple of widgets, one for the start and another for end date. I want them to appear in that order but when I run the code below, end date shows up before the start date. How can order in the way I I desired?

dbutils.widgets.text("start_date", "yyyy-mm-dd", "start_date")

dbutils.widgets.text("end_date", "yyyy-mm-dd", "end_date")

1 ACCEPTED SOLUTION

Accepted Solutions

Ravi
Databricks Employee
Databricks Employee

@Laura Blancarte​ @Werner Stinckens​ You can change the order of widgets displayed in the notebook by going into widget edit mode and dragging the widget to the expected order.

image.pngimage

View solution in original post

5 REPLIES 5

-werners-
Esteemed Contributor III

I think widgets are ordered by their label.

So if you would change your label of end_date to zend_date it would appear last.

But that is not very interesting ofc.

I tried if this works with the widget name but that does not do anything.

Ravi
Databricks Employee
Databricks Employee

@Laura Blancarte​ @Werner Stinckens​ You can change the order of widgets displayed in the notebook by going into widget edit mode and dragging the widget to the expected order.

image.pngimage

laus
New Contributor III

@Ravirahul Padmanabhan​  and @Werner Stinckens​ , for me going into edit mode as suggested by Ravi worked like a charm! Thank you both!

Hubert-Dudek
Esteemed Contributor III

Hi @Laura Blancarte​ , That's awesome. Would you like to mark @Ravirahul Padmanabhan​ post as the best answer?

laus
New Contributor III

Done 🙂

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