<?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: Expression to check if predecessor activity was executed in Pipelines</title>
    <link>https://community.fabric.microsoft.com/t5/Pipelines/Expression-to-check-if-predecessor-activity-was-executed/m-p/4252052#M6004</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the &lt;STRONG&gt;@activity&lt;/STRONG&gt; function in an expression to check if the preceding activity is executed. Below is an example:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;@if(equals(activity('YourActivityName').status, 'Succeeded'), 'Activity was executed', 'Activity was not executed')&lt;/LI-CODE&gt;
&lt;P&gt;In this expression, replace YourActivityName with the name of your front activity. This will check the status of the activity and return a message indicating whether or not it was executed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need to check for errors specifically, you can modify the expression to check for the presence of the error attribute:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;@if(equals(activity('YourActivityName').status, 'Failed'), 'Activity failed', 'Activity succeeded or was not executed')&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Adamk Kong&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post &lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider Accept it as the solution to help the other members find it more quickly&lt;/P&gt;</description>
    <pubDate>Tue, 22 Oct 2024 06:59:02 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-10-22T06:59:02Z</dc:date>
    <item>
      <title>Expression to check if predecessor activity was executed</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Expression-to-check-if-predecessor-activity-was-executed/m-p/4250665#M5992</link>
      <description>&lt;P&gt;I have developed a pipeline that incorporates a conditional flow. Based on whether a specific condition is true or false, a corresponding set of activities is executed.&lt;BR /&gt;&lt;STRONG&gt;True Condition:&lt;/STRONG&gt; Executes Set A of activities.&lt;BR /&gt;&lt;STRONG&gt;False Condition:&lt;/STRONG&gt; Executes Set B of activities.&lt;BR /&gt;I have a successor Outlook activity linked to the "If" activity, which is used to send a notification in case of execution failure. However, since some activities are not executed based on the condition, the expression in the Outlook activity to check the "If" activity's output for errors throws the following error:"&lt;STRONG&gt;Property cannot be evaluated because property 'Error' cannot be selected&lt;/STRONG&gt;."&lt;/P&gt;&lt;P&gt;My understanding is that we can only refer to activity outputs for those activities that have been executed in expressions.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Question:&lt;/STRONG&gt;&lt;BR /&gt;Is it possible to check if the predecessor activity was triggered using expressions, so I can determine if the activity has an output?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2024 11:12:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Expression-to-check-if-predecessor-activity-was-executed/m-p/4250665#M5992</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-10-21T11:12:26Z</dc:date>
    </item>
    <item>
      <title>Re: Expression to check if predecessor activity was executed</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Expression-to-check-if-predecessor-activity-was-executed/m-p/4252052#M6004</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the &lt;STRONG&gt;@activity&lt;/STRONG&gt; function in an expression to check if the preceding activity is executed. Below is an example:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;@if(equals(activity('YourActivityName').status, 'Succeeded'), 'Activity was executed', 'Activity was not executed')&lt;/LI-CODE&gt;
&lt;P&gt;In this expression, replace YourActivityName with the name of your front activity. This will check the status of the activity and return a message indicating whether or not it was executed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need to check for errors specifically, you can modify the expression to check for the presence of the error attribute:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;@if(equals(activity('YourActivityName').status, 'Failed'), 'Activity failed', 'Activity succeeded or was not executed')&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Adamk Kong&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post &lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider Accept it as the solution to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2024 06:59:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Expression-to-check-if-predecessor-activity-was-executed/m-p/4252052#M6004</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-10-22T06:59:02Z</dc:date>
    </item>
  </channel>
</rss>

