<?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: Can SQL task pass its outputs to ForEach task? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/can-sql-task-pass-its-outputs-to-foreach-task/m-p/103036#M41303</link>
    <description>&lt;P&gt;May I know from which blog or webinar did you get the information provided in the original post?&lt;/P&gt;</description>
    <pubDate>Mon, 23 Dec 2024 15:24:06 GMT</pubDate>
    <dc:creator>Walter_C</dc:creator>
    <dc:date>2024-12-23T15:24:06Z</dc:date>
    <item>
      <title>Can SQL task pass its outputs to ForEach task?</title>
      <link>https://community.databricks.com/t5/data-engineering/can-sql-task-pass-its-outputs-to-foreach-task/m-p/102868#M41258</link>
      <description>&lt;P&gt;Hi there,&lt;BR /&gt;If I understood correctly, Roland said output&amp;nbsp;SQL task can be used as input&amp;nbsp;to ForEach task in Workflows. I tried that and used the expression sqlTaskName.output.rows, but Databricks rejected that expression. Anyone know how to do that?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Dec 2024 22:24:43 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/can-sql-task-pass-its-outputs-to-foreach-task/m-p/102868#M41258</guid>
      <dc:creator>Fikrat</dc:creator>
      <dc:date>2024-12-20T22:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: Can SQL task pass its outputs to ForEach task?</title>
      <link>https://community.databricks.com/t5/data-engineering/can-sql-task-pass-its-outputs-to-foreach-task/m-p/102871#M41260</link>
      <description>&lt;P&gt;Can you confirm if this are the steps being followed:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;P class="_1t7bu9h1 paragraph"&gt;&lt;SPAN&gt;&lt;STRONG&gt;Create the SQL Task&lt;/STRONG&gt;: Ensure your SQL task is correctly set up and produces the desired output. For example:&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV class="gb5fhw2"&gt;
&lt;PRE&gt;&lt;CODE class="markdown-code-sql _1t7bu9hb hljs language-sql gb5fhw3"&gt;&lt;SPAN class="hljs-keyword"&gt;SELECT&lt;/SPAN&gt; customer_name, market &lt;SPAN class="hljs-keyword"&gt;FROM&lt;/SPAN&gt; example_customers;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P class="_1t7bu9h1 paragraph"&gt;&lt;SPAN&gt;&lt;STRONG&gt;Reference the SQL Task Output in ForEach Task&lt;/STRONG&gt;:&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL class="_1t7bu9h7 _1t7bu9h2"&gt;
&lt;LI&gt;&lt;SPAN&gt;Use the correct syntax to reference the rows output. The expression should be in the format &lt;CODE&gt;{{ tasks.sqlTaskName.output.rows }}&lt;/CODE&gt;.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Ensure that the SQL task name (&lt;CODE&gt;sqlTaskName&lt;/CODE&gt;) matches the task key you have defined in your workflow.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P class="_1t7bu9h1 paragraph"&gt;&lt;SPAN&gt;&lt;STRONG&gt;Configure the ForEach Task&lt;/STRONG&gt;:&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL class="_1t7bu9h7 _1t7bu9h2"&gt;
&lt;LI&gt;&lt;SPAN&gt;Set the &lt;CODE&gt;inputs&lt;/CODE&gt; field of the ForEach task to &lt;CODE&gt;{{ tasks.sqlTaskName.output.rows }}&lt;/CODE&gt;.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Define the nested task within the ForEach task to process each row. For example:&lt;/SPAN&gt;
&lt;DIV class="gb5fhw2"&gt;
&lt;PRE&gt;&lt;CODE class="markdown-code-json _1t7bu9hb hljs language-json gb5fhw3"&gt;&lt;SPAN class="hljs-punctuation"&gt;{&lt;/SPAN&gt;
  &lt;SPAN class="hljs-attr"&gt;"task_key"&lt;/SPAN&gt;&lt;SPAN class="hljs-punctuation"&gt;:&lt;/SPAN&gt; &lt;SPAN class="hljs-string"&gt;"process_customers_iteration"&lt;/SPAN&gt;&lt;SPAN class="hljs-punctuation"&gt;,&lt;/SPAN&gt;
  &lt;SPAN class="hljs-attr"&gt;"parameters"&lt;/SPAN&gt;&lt;SPAN class="hljs-punctuation"&gt;:&lt;/SPAN&gt; &lt;SPAN class="hljs-punctuation"&gt;{&lt;/SPAN&gt;
    &lt;SPAN class="hljs-attr"&gt;"customer_name"&lt;/SPAN&gt;&lt;SPAN class="hljs-punctuation"&gt;:&lt;/SPAN&gt; &lt;SPAN class="hljs-string"&gt;"{{ input.customer_name }}"&lt;/SPAN&gt;&lt;SPAN class="hljs-punctuation"&gt;,&lt;/SPAN&gt;
    &lt;SPAN class="hljs-attr"&gt;"market"&lt;/SPAN&gt;&lt;SPAN class="hljs-punctuation"&gt;:&lt;/SPAN&gt; &lt;SPAN class="hljs-string"&gt;"{{ input.market }}"&lt;/SPAN&gt;
  &lt;SPAN class="hljs-punctuation"&gt;}&lt;/SPAN&gt;&lt;SPAN class="hljs-punctuation"&gt;,&lt;/SPAN&gt;
  &lt;SPAN class="hljs-attr"&gt;"sql_task"&lt;/SPAN&gt;&lt;SPAN class="hljs-punctuation"&gt;:&lt;/SPAN&gt; &lt;SPAN class="hljs-punctuation"&gt;{&lt;/SPAN&gt;
    &lt;SPAN class="hljs-attr"&gt;"file"&lt;/SPAN&gt;&lt;SPAN class="hljs-punctuation"&gt;:&lt;/SPAN&gt; &lt;SPAN class="hljs-punctuation"&gt;{&lt;/SPAN&gt;
      &lt;SPAN class="hljs-attr"&gt;"path"&lt;/SPAN&gt;&lt;SPAN class="hljs-punctuation"&gt;:&lt;/SPAN&gt; &lt;SPAN class="hljs-string"&gt;"/path/to/your/sql/file.sql"&lt;/SPAN&gt;
    &lt;SPAN class="hljs-punctuation"&gt;}&lt;/SPAN&gt;
  &lt;SPAN class="hljs-punctuation"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="hljs-punctuation"&gt;}&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Dec 2024 02:27:10 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/can-sql-task-pass-its-outputs-to-foreach-task/m-p/102871#M41260</guid>
      <dc:creator>Walter_C</dc:creator>
      <dc:date>2024-12-21T02:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: Can SQL task pass its outputs to ForEach task?</title>
      <link>https://community.databricks.com/t5/data-engineering/can-sql-task-pass-its-outputs-to-foreach-task/m-p/102914#M41267</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;Thanks for looking at this. I followed your instructions to the letter, but Databricks refused to accept that dynamic expression for the input of foreach task, see the screenshot.And output.rows expression is not among dynamic expressions offered by 'Inputs' box.Also, I can't even save that setting for ForEach task, let alone to execute it. Please advise.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Dec 2024 21:05:39 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/can-sql-task-pass-its-outputs-to-foreach-task/m-p/102914#M41267</guid>
      <dc:creator>Fikrat</dc:creator>
      <dc:date>2024-12-21T21:05:39Z</dc:date>
    </item>
    <item>
      <title>Re: Can SQL task pass its outputs to ForEach task?</title>
      <link>https://community.databricks.com/t5/data-engineering/can-sql-task-pass-its-outputs-to-foreach-task/m-p/103036#M41303</link>
      <description>&lt;P&gt;May I know from which blog or webinar did you get the information provided in the original post?&lt;/P&gt;</description>
      <pubDate>Mon, 23 Dec 2024 15:24:06 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/can-sql-task-pass-its-outputs-to-foreach-task/m-p/103036#M41303</guid>
      <dc:creator>Walter_C</dc:creator>
      <dc:date>2024-12-23T15:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: Can SQL task pass its outputs to ForEach task?</title>
      <link>https://community.databricks.com/t5/data-engineering/can-sql-task-pass-its-outputs-to-foreach-task/m-p/103043#M41307</link>
      <description>&lt;P&gt;I got it from this:&lt;BR /&gt;&lt;A href="https://www.youtube.com/watch?v=YtyrF1zFzQI&amp;amp;t=568s" target="_blank"&gt;What's New in Databricks Workflows - with Live Demos!&lt;/A&gt;&lt;BR /&gt;He's demoing haw sql task output can be consumed at around 9-th min&lt;/P&gt;</description>
      <pubDate>Mon, 23 Dec 2024 16:35:49 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/can-sql-task-pass-its-outputs-to-foreach-task/m-p/103043#M41307</guid>
      <dc:creator>Fikrat</dc:creator>
      <dc:date>2024-12-23T16:35:49Z</dc:date>
    </item>
    <item>
      <title>Re: Can SQL task pass its outputs to ForEach task?</title>
      <link>https://community.databricks.com/t5/data-engineering/can-sql-task-pass-its-outputs-to-foreach-task/m-p/103058#M41320</link>
      <description>&lt;P&gt;I am asking internally on this, will get back to you once I have more details&lt;/P&gt;</description>
      <pubDate>Mon, 23 Dec 2024 18:29:33 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/can-sql-task-pass-its-outputs-to-foreach-task/m-p/103058#M41320</guid>
      <dc:creator>Walter_C</dc:creator>
      <dc:date>2024-12-23T18:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: Can SQL task pass its outputs to ForEach task?</title>
      <link>https://community.databricks.com/t5/data-engineering/can-sql-task-pass-its-outputs-to-foreach-task/m-p/103156#M41351</link>
      <description>&lt;P&gt;Our internal teams has confirmed that this is currently not working on your side as this feature is currently in Private preview we will need to wait for some time until it is fully released.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2024 17:59:48 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/can-sql-task-pass-its-outputs-to-foreach-task/m-p/103156#M41351</guid>
      <dc:creator>Walter_C</dc:creator>
      <dc:date>2024-12-24T17:59:48Z</dc:date>
    </item>
  </channel>
</rss>

