<?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: Access Each Input Item of a For Each Task in Warehousing &amp; Analytics</title>
    <link>https://community.databricks.com/t5/warehousing-analytics/access-each-input-item-of-a-for-each-task/m-p/102423#M1759</link>
    <description>&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;To access each item of the iteration within the notebook of the second task in your Databricks workflow, you need to utilize the parameterization feature of the&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;For Each&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;&amp;nbsp;task. Instead of trying to retrieve the entire list using&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="s3"&gt;dbutils.jobs.taskValues.get&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;, you should configure the&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;For Each&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;&amp;nbsp;task to pass individual items of the&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="s3"&gt;Input_List&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;&amp;nbsp;to each iteration as parameters.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 17 Dec 2024 20:50:03 GMT</pubDate>
    <dc:creator>Louis_Frolio</dc:creator>
    <dc:date>2024-12-17T20:50:03Z</dc:date>
    <item>
      <title>Access Each Input Item of a For Each Task</title>
      <link>https://community.databricks.com/t5/warehousing-analytics/access-each-input-item-of-a-for-each-task/m-p/102414#M1758</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I have two tasks. The first task (Sample_Notebook) returns a JSON array (Input_List). &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Sample data in Input_List&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;['key1':value1, 'key2':value2, 'key3':value3]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The second task is a "For Each" task that executes a notebook for each entry in the Input_List.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The number of Iterations are as expected and even the key/value pairs are showing fine in the job window. However,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I am not sure how to access each item within the Notebook of the second task.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The below command does not work properly&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;dbutils.jobs.taskValues.get(taskKey="Sample_Notebook",key="Input_List")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;It simply throws the complete input for each iteration.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;How to access the corresponding item of the iteration?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 17 Dec 2024 17:38:18 GMT</pubDate>
      <guid>https://community.databricks.com/t5/warehousing-analytics/access-each-input-item-of-a-for-each-task/m-p/102414#M1758</guid>
      <dc:creator>rk2511</dc:creator>
      <dc:date>2024-12-17T17:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: Access Each Input Item of a For Each Task</title>
      <link>https://community.databricks.com/t5/warehousing-analytics/access-each-input-item-of-a-for-each-task/m-p/102423#M1759</link>
      <description>&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;To access each item of the iteration within the notebook of the second task in your Databricks workflow, you need to utilize the parameterization feature of the&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;For Each&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;&amp;nbsp;task. Instead of trying to retrieve the entire list using&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="s3"&gt;dbutils.jobs.taskValues.get&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;, you should configure the&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;For Each&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;&amp;nbsp;task to pass individual items of the&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="s3"&gt;Input_List&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;&amp;nbsp;to each iteration as parameters.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2024 20:50:03 GMT</pubDate>
      <guid>https://community.databricks.com/t5/warehousing-analytics/access-each-input-item-of-a-for-each-task/m-p/102423#M1759</guid>
      <dc:creator>Louis_Frolio</dc:creator>
      <dc:date>2024-12-17T20:50:03Z</dc:date>
    </item>
  </channel>
</rss>

