<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Notebook dropdown widget in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/notebook-dropdown-widget/m-p/25218#M17510</link>
    <description>&lt;P&gt;I have created a dropdown (say B) in my notebook whose input depend on dropdown( say B). So if select some value in dropdown A, it corresponding value appears in B dropdown &amp;amp; i'm selecting one amongst it. Now if i change the value in dropdown A, then Value in drop B is also changing but the one previously selected is still there.  Is there any way if i cab refresh that dropdown.&lt;/P&gt;</description>
    <pubDate>Fri, 18 Mar 2022 11:57:34 GMT</pubDate>
    <dc:creator>Sagar1</dc:creator>
    <dc:date>2022-03-18T11:57:34Z</dc:date>
    <item>
      <title>Notebook dropdown widget</title>
      <link>https://community.databricks.com/t5/data-engineering/notebook-dropdown-widget/m-p/25218#M17510</link>
      <description>&lt;P&gt;I have created a dropdown (say B) in my notebook whose input depend on dropdown( say B). So if select some value in dropdown A, it corresponding value appears in B dropdown &amp;amp; i'm selecting one amongst it. Now if i change the value in dropdown A, then Value in drop B is also changing but the one previously selected is still there.  Is there any way if i cab refresh that dropdown.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Mar 2022 11:57:34 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/notebook-dropdown-widget/m-p/25218#M17510</guid>
      <dc:creator>Sagar1</dc:creator>
      <dc:date>2022-03-18T11:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: Notebook dropdown widget</title>
      <link>https://community.databricks.com/t5/data-engineering/notebook-dropdown-widget/m-p/25220#M17512</link>
      <description>&lt;P&gt;Hi @Kaniz Fatma​&amp;nbsp;,&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;I tried and explored all the documents before raising question here, but none of them has solution for my problem. There after i relaize that like remove widget we must have reset widget option as well, which will reset it to its default value, as we are providing it during its creation.​&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2022 16:09:08 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/notebook-dropdown-widget/m-p/25220#M17512</guid>
      <dc:creator>Sagar1</dc:creator>
      <dc:date>2022-03-22T16:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: Notebook dropdown widget</title>
      <link>https://community.databricks.com/t5/data-engineering/notebook-dropdown-widget/m-p/25222#M17514</link>
      <description>&lt;P&gt;Yes, @Kaniz Fatma​&amp;nbsp; I would like to raise a request on ideas portal.​&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2022 17:28:52 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/notebook-dropdown-widget/m-p/25222#M17514</guid>
      <dc:creator>Sagar1</dc:creator>
      <dc:date>2022-03-22T17:28:52Z</dc:date>
    </item>
    <item>
      <title>Re: Notebook dropdown widget</title>
      <link>https://community.databricks.com/t5/data-engineering/notebook-dropdown-widget/m-p/25225#M17517</link>
      <description>&lt;P&gt;If the previously selected value of B is not meant to be in the list of values for newly selected dropdown A value, then you could set a default value (ie: 'No selection') that the B dropdown should have when first created. In a method to define how you create B, check if current  B value is not valid for A, if it is not then create the dropdown widget with the default value.&lt;/P&gt;&lt;P&gt;If the value of B makes sense also when dropdown A changes, try to find a way to figure out if A changed. For example write the code to create B in a cell where you also call dbutils.widgets.get(A). This will run the cell when A changes, then create B with the default value. When running the cell that checks if A changed, also write create_B (input_values, 'No selection'). &lt;/P&gt;&lt;P&gt;It's complicated, but follow the logic and you will get there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;def create_B (input_values, default):
   values = [value for value in input_values]
  if (default not in values):
     default = 'No selection'
  if ('No selection' not in values):
     values.insert(0, 'No selection')
 dbutils.widgets.dropdown('widget B', default, values)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 13:06:47 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/notebook-dropdown-widget/m-p/25225#M17517</guid>
      <dc:creator>nic_paul24</dc:creator>
      <dc:date>2023-03-16T13:06:47Z</dc:date>
    </item>
  </channel>
</rss>

