<?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 Re: Set up Loacation using widget in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/set-up-loacation-using-widget/m-p/101804#M40833</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/135991"&gt;@Timmes0815&lt;/a&gt;&amp;nbsp; - could you please try the below example and let us know?&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Location_Path = dbutils.widgets.text("Location_Path","")
Location_Path = dbutils.widgets.getArgument("Location_Path")
display(Location_Path)
dbutils.notebook.run("Notebook2", 600, {"Location_Path":Location_Path})&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 11 Dec 2024 17:12:38 GMT</pubDate>
    <dc:creator>shan_chandra</dc:creator>
    <dc:date>2024-12-11T17:12:38Z</dc:date>
    <item>
      <title>Set up Loacation using widget</title>
      <link>https://community.databricks.com/t5/data-engineering/set-up-loacation-using-widget/m-p/101800#M40830</link>
      <description>&lt;P&gt;I'm struggeling using the databricks widget to set up the location in an sql create table statement.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the following to set up the location:&lt;/P&gt;&lt;P&gt;&lt;U&gt;Step1: Creating a notebook (Notebook1) to define the variable.&lt;/U&gt;&lt;/P&gt;&lt;P&gt;Location_Path =&amp;nbsp; &amp;nbsp;'&lt;SPAN&gt;abfss:xxxxx@xxxx.xxx.net/Tabelname1'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;SPAN&gt;Step2:&amp;nbsp;Creating a notebook with widgets (Notebook2) to create the table.&lt;/SPAN&gt;&lt;/U&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Cell1:&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;%python&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;# create the widget with the location path&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;dbutils.widgets.&lt;/SPAN&gt;&lt;SPAN&gt;text&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"Location_Path"&lt;/SPAN&gt;&lt;SPAN&gt;, "")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;Cell2:&lt;/P&gt;&lt;P&gt;%sql&lt;/P&gt;&lt;P&gt;-- create table using widget&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CREATE OR REPLACE&lt;/SPAN&gt; &lt;SPAN&gt;TABLE&lt;/SPAN&gt;&amp;nbsp;schema.Tabelname1&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;LOCATION&lt;/SPAN&gt;&lt;SPAN&gt; :Location_Path&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;AS&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SELECT&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;from&amp;nbsp;schema.Tabelname&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;Step 3: Runing Notebook2 from Notebook1 using&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;dbutils.notebook.&lt;/SPAN&gt;&lt;SPAN&gt;run() function&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;SPAN&gt;dbutils.notebook.&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;run("&lt;U&gt;Notebook2&lt;/U&gt;", 600, {&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;SPAN&gt;Location_Path&lt;/SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;:Location_Path}&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Is there documentation available how to setup the location using a test widget?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 16:47:41 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/set-up-loacation-using-widget/m-p/101800#M40830</guid>
      <dc:creator>Timmes0815</dc:creator>
      <dc:date>2024-12-11T16:47:41Z</dc:date>
    </item>
    <item>
      <title>Re: Set up Loacation using widget</title>
      <link>https://community.databricks.com/t5/data-engineering/set-up-loacation-using-widget/m-p/101804#M40833</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/135991"&gt;@Timmes0815&lt;/a&gt;&amp;nbsp; - could you please try the below example and let us know?&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Location_Path = dbutils.widgets.text("Location_Path","")
Location_Path = dbutils.widgets.getArgument("Location_Path")
display(Location_Path)
dbutils.notebook.run("Notebook2", 600, {"Location_Path":Location_Path})&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 17:12:38 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/set-up-loacation-using-widget/m-p/101804#M40833</guid>
      <dc:creator>shan_chandra</dc:creator>
      <dc:date>2024-12-11T17:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: Set up Loacation using widget</title>
      <link>https://community.databricks.com/t5/data-engineering/set-up-loacation-using-widget/m-p/101905#M40878</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/616"&gt;@shan_chandra&lt;/a&gt;&amp;nbsp;thainks for your reply. I tried it today but it didn't work. The result from display(Location_Path) is exactly the name of the location. The location is something like&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;'abfss://abcd@xxxxx.dfs.core.windows.net/mytable'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Puting the location into the SQL works using the :Location_Path Parameter fails. Strange is, that I've additional parameters in my SQL&amp;nbsp;like "Start_Date" and "End_Date" which works fine. Only the parameter for the location is not working.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2024 12:27:42 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/set-up-loacation-using-widget/m-p/101905#M40878</guid>
      <dc:creator>Timmes0815</dc:creator>
      <dc:date>2024-12-12T12:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: Set up Loacation using widget</title>
      <link>https://community.databricks.com/t5/data-engineering/set-up-loacation-using-widget/m-p/102633#M41186</link>
      <description>&lt;P&gt;I finaly solved my problem by using the parameters in python F-Strings:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Location_Path = dbutils.widgets.text("Location_Path","")

-- create table using widget 
query = f"""
CREATE OR REPLACE TABLE schema.Tabelname1
LOCATION '{Location_Path}'
AS
SELECT
...
from schema.Tabelname&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2024 10:08:30 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/set-up-loacation-using-widget/m-p/102633#M41186</guid>
      <dc:creator>Timmes0815</dc:creator>
      <dc:date>2024-12-19T10:08:30Z</dc:date>
    </item>
  </channel>
</rss>

