<?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 Databricks  Workflow if else task type in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/databricks-workflow-if-else-task-type/m-p/91571#M38207</link>
    <description>&lt;P&gt;Need help on databricks workflow if else task.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Task-A : Notebook : executing set of the pyspark commands and loading the data into delta table.&lt;/P&gt;&lt;P&gt;I need to setup a custom status so that i can use status in the next if/else task.&lt;/P&gt;&lt;P&gt;Task-b: if/else: once i get the status of the previous task based on the status i need execute the set of notebook on True condition else stop the workflow.&lt;/P&gt;&lt;P&gt;need help on how to set and get the status of the previous notebook to current if/else task.&lt;/P&gt;&lt;P&gt;@databricksworkflow&lt;/P&gt;&lt;P&gt;#&lt;/P&gt;</description>
    <pubDate>Tue, 24 Sep 2024 12:34:10 GMT</pubDate>
    <dc:creator>suryateja405555</dc:creator>
    <dc:date>2024-09-24T12:34:10Z</dc:date>
    <item>
      <title>Databricks  Workflow if else task type</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-workflow-if-else-task-type/m-p/91571#M38207</link>
      <description>&lt;P&gt;Need help on databricks workflow if else task.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Task-A : Notebook : executing set of the pyspark commands and loading the data into delta table.&lt;/P&gt;&lt;P&gt;I need to setup a custom status so that i can use status in the next if/else task.&lt;/P&gt;&lt;P&gt;Task-b: if/else: once i get the status of the previous task based on the status i need execute the set of notebook on True condition else stop the workflow.&lt;/P&gt;&lt;P&gt;need help on how to set and get the status of the previous notebook to current if/else task.&lt;/P&gt;&lt;P&gt;@databricksworkflow&lt;/P&gt;&lt;P&gt;#&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2024 12:34:10 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-workflow-if-else-task-type/m-p/91571#M38207</guid>
      <dc:creator>suryateja405555</dc:creator>
      <dc:date>2024-09-24T12:34:10Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks  Workflow if else task type</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-workflow-if-else-task-type/m-p/91572#M38208</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/118910"&gt;@suryateja405555&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;You can use task values in Task A to setup a custom status and then use that status in the if/else task to decide if you need to execute the of notebook on True condition or stop the workflow.&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.databricks.com/en/jobs/share-task-context.html#using-task-values" target="_blank"&gt;https://docs.databricks.com/en/jobs/share-task-context.html#using-task-values&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2024 12:53:49 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-workflow-if-else-task-type/m-p/91572#M38208</guid>
      <dc:creator>szymon_dybczak</dc:creator>
      <dc:date>2024-09-24T12:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks  Workflow if else task type</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-workflow-if-else-task-type/m-p/91575#M38210</link>
      <description>&lt;P&gt;but what is if/else expression we need to write to get the values from the previous task,&lt;/P&gt;&lt;P&gt;i tried with "tasks.previous_task_name.values.value_of_previous_task" =="SUCCESS" in the expression. throwing an error task value referenced by&amp;nbsp; tasks.&amp;lt;previous_task&amp;gt;.values.value was not found.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i tried to declare/set a custom status by using these approaches.&lt;/P&gt;&lt;P&gt;1) dbutils.notebook.exit({status:"success"})&amp;nbsp; 2) dbutils.job.taskValues.get(key="status",values ="success")&lt;/P&gt;&lt;P&gt;Need your help to write if/else expression to get the value.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks !!!&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2024 13:15:35 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-workflow-if-else-task-type/m-p/91575#M38210</guid>
      <dc:creator>suryateja405555</dc:creator>
      <dc:date>2024-09-24T13:15:35Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks  Workflow if else task type</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-workflow-if-else-task-type/m-p/91579#M38211</link>
      <description>&lt;P&gt;You have error in your code. To set a task value you should use dbutils.job.taskValues.&lt;STRONG&gt;set&amp;nbsp;&lt;/STRONG&gt;command. Instead, in&amp;nbsp; code you've provided you're using dbutils.job.taskValues.&lt;STRONG&gt;get&lt;/STRONG&gt;&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;BR /&gt;Look at below picture. Here I have sample notebook where I'm setting status to "success"&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="szymon_dybczak_2-1727184822477.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/11458i953063CA85030A77/image-size/medium?v=v2&amp;amp;px=400" role="button" title="szymon_dybczak_2-1727184822477.png" alt="szymon_dybczak_2-1727184822477.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Then I created sample workflow:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="szymon_dybczak_0-1727184733859.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/11456i833CB36AD1999665/image-size/medium?v=v2&amp;amp;px=400" role="button" title="szymon_dybczak_0-1727184733859.png" alt="szymon_dybczak_0-1727184733859.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In if/else task I'm reffering to task value in following way:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="szymon_dybczak_1-1727184765037.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/11457i608440AB5ADB7F9A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="szymon_dybczak_1-1727184765037.png" alt="szymon_dybczak_1-1727184765037.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2024 13:50:09 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-workflow-if-else-task-type/m-p/91579#M38211</guid>
      <dc:creator>szymon_dybczak</dc:creator>
      <dc:date>2024-09-24T13:50:09Z</dc:date>
    </item>
  </channel>
</rss>

