Search code examples
azure-databricks

Python Azure Databricks order of widgets not alphabetic


I am creating a form with three widgets. Somehow Microsoft Azure Databricks sorts the widgets alphabetically, so that IP From comes before Type. How can I make Type come before IP From?

# Form
dbutils.widgets.removeAll()
dbutils.widgets.dropdown(name="inp_type", defaultValue="IP", choices=["IP", "Host"], label="Type:")
dbutils.widgets.text(name="inp_ip_from", defaultValue="none", label="IP From:")
dbutils.widgets.text(name="inp_ip_to", defaultValue="none", label="IP To:")

This is what I have:

enter image description here

This is what I want:

enter image description here


Solution

  • How can I make Type come before IP From?

    To fix your issue, please drag and drop your required widgets in an order.

    Below are the steps to fix it in an order.

    1. Click on the edit option from ADB Workspace Notebook as shown in below screenshot,

    enter image description here

    1. Drag the widgets in order you want to place it and click on save.

    enter image description here

    Output: enter image description here