<?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 Condition for matching in the workflow in Automations</title>
    <link>https://community.dynatrace.com/t5/Automations/Condition-for-matching-in-the-workflow/m-p/236182#M1445</link>
    <description>&lt;P&gt;Hello everybody&lt;/P&gt;
&lt;P&gt;I'm setting up a simple workflow with the following flow:&lt;/P&gt;
&lt;P&gt;job_test: executes the query below:&lt;BR /&gt;&lt;BR /&gt;fetch logs, from: -1d&lt;BR /&gt;| filter contains(content, "Job_OK_Test")&lt;BR /&gt;| summarize count()&lt;BR /&gt;&lt;BR /&gt;And the result if positive is:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="heldercosta82_0-1706900071451.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/17376i4A854EDA070C2BEE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="heldercosta82_0-1706900071451.png" alt="heldercosta82_0-1706900071451.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the next step, send_messafe_ok&lt;BR /&gt;I configured the following condition: "{{ result("job_test").records | length &amp;gt; 0 }}"&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="heldercosta82_1-1706900296783.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/17377iC21AF9B97EE2AC91/image-size/medium?v=v2&amp;amp;px=400" role="button" title="heldercosta82_1-1706900296783.png" alt="heldercosta82_1-1706900296783.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;But I believe I'm skipping a step, because it's not matching and the flow stops with the following error:&lt;/P&gt;
&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&lt;SPAN&gt;Error evaluating custom condition - Attempting to use result of unfinished task. Please make job_test a predecessor of send_message_ok.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="wf-dyna.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/17379i34422B08DB0009A3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="wf-dyna.png" alt="wf-dyna.png" /&gt;&lt;/span&gt;&lt;BR /&gt;If anyone can share something I would be grateful.&lt;BR /&gt;&lt;BR /&gt;Tks&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 07 Feb 2024 08:33:18 GMT</pubDate>
    <dc:creator>HelderCosta</dc:creator>
    <dc:date>2024-02-07T08:33:18Z</dc:date>
    <item>
      <title>Condition for matching in the workflow</title>
      <link>https://community.dynatrace.com/t5/Automations/Condition-for-matching-in-the-workflow/m-p/236182#M1445</link>
      <description>&lt;P&gt;Hello everybody&lt;/P&gt;
&lt;P&gt;I'm setting up a simple workflow with the following flow:&lt;/P&gt;
&lt;P&gt;job_test: executes the query below:&lt;BR /&gt;&lt;BR /&gt;fetch logs, from: -1d&lt;BR /&gt;| filter contains(content, "Job_OK_Test")&lt;BR /&gt;| summarize count()&lt;BR /&gt;&lt;BR /&gt;And the result if positive is:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="heldercosta82_0-1706900071451.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/17376i4A854EDA070C2BEE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="heldercosta82_0-1706900071451.png" alt="heldercosta82_0-1706900071451.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the next step, send_messafe_ok&lt;BR /&gt;I configured the following condition: "{{ result("job_test").records | length &amp;gt; 0 }}"&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="heldercosta82_1-1706900296783.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/17377iC21AF9B97EE2AC91/image-size/medium?v=v2&amp;amp;px=400" role="button" title="heldercosta82_1-1706900296783.png" alt="heldercosta82_1-1706900296783.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;But I believe I'm skipping a step, because it's not matching and the flow stops with the following error:&lt;/P&gt;
&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&lt;SPAN&gt;Error evaluating custom condition - Attempting to use result of unfinished task. Please make job_test a predecessor of send_message_ok.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="wf-dyna.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/17379i34422B08DB0009A3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="wf-dyna.png" alt="wf-dyna.png" /&gt;&lt;/span&gt;&lt;BR /&gt;If anyone can share something I would be grateful.&lt;BR /&gt;&lt;BR /&gt;Tks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2024 08:33:18 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Condition-for-matching-in-the-workflow/m-p/236182#M1445</guid>
      <dc:creator>HelderCosta</dc:creator>
      <dc:date>2024-02-07T08:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: Condition for matching in the workflow</title>
      <link>https://community.dynatrace.com/t5/Automations/Condition-for-matching-in-the-workflow/m-p/237248#M1469</link>
      <description>&lt;P&gt;For it to work we need to adjust the DQL as follows:&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;fetch logs, from: -10h&lt;BR /&gt;| filter contains(content, "Finalizado DesativarAnunciosPJSemAtualizacaoJob")&lt;BR /&gt;| summarize execute = count()&lt;BR /&gt;| FieldsAdd response = if(execute &amp;gt; 0, "true",else:"false")&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HelderCosta_0-1708006523307.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/17630iED73BB9E5B6F8CAE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HelderCosta_0-1708006523307.png" alt="HelderCosta_0-1708006523307.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;And the result will show true or false, and this value we will set the condition for sending the message:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HelderCosta_1-1708006744477.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/17631i1B07BFDFE256758B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HelderCosta_1-1708006744477.png" alt="HelderCosta_1-1708006744477.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;Condition Send Message OK:&lt;BR /&gt;{{ result("job_desativa_anuncio_pj").records[0].response == 'true' }}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Condition Send Message Fail:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{{ result("job_desativa_anuncio_pj").records[0].response == 'false' }}&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2024 14:20:37 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Condition-for-matching-in-the-workflow/m-p/237248#M1469</guid>
      <dc:creator>HelderCosta</dc:creator>
      <dc:date>2024-02-15T14:20:37Z</dc:date>
    </item>
  </channel>
</rss>

