<?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: How to compose a condition with an if statement in workflows in Automations</title>
    <link>https://community.dynatrace.com/t5/Automations/How-to-compose-a-condition-with-an-if-statement-in-workflows/m-p/254356#M1762</link>
    <description>&lt;P&gt;If your value is already a boolean, I don't think you need to use the "&lt;EM&gt;== true&lt;/EM&gt;" part. Also make sure your result is being returned in the previous step.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Something like this should work:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Eric_Yu_0-1724795865894.png" style="width: 842px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/22053i704431572A7681F1/image-dimensions/842x342?v=v2" width="842" height="342" role="button" title="Eric_Yu_0-1724795865894.png" alt="Eric_Yu_0-1724795865894.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 27 Aug 2024 21:58:21 GMT</pubDate>
    <dc:creator>Eric_Yu</dc:creator>
    <dc:date>2024-08-27T21:58:21Z</dc:date>
    <item>
      <title>How to compose a condition with an if statement in workflows</title>
      <link>https://community.dynatrace.com/t5/Automations/How-to-compose-a-condition-with-an-if-statement-in-workflows/m-p/254271#M1760</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;i'm trying to figure out how the if statements work in conditions in workflows using this doc&lt;BR /&gt;&lt;A href="https://docs.dynatrace.com/docs/platform-modules/automations/workflows/reference#if-statement" target="_self"&gt;&amp;nbsp;https://docs.dynatrace.com/docs/platform-modules/automations/workflows/reference#if-statement&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I have a 3rd actions that should only fire when a value from the first actions and one from the seccond action equal a string.&lt;/P&gt;&lt;P&gt;I started off by just trying an if for the first action, but it never seems to trigger.&lt;/P&gt;&lt;P&gt;{%if result('action1').production == true %}&lt;BR /&gt;{% endif %}&lt;/P&gt;&lt;P&gt;a more simple version does work&lt;/P&gt;&lt;P&gt;{{result('action1').production == true}}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how do yo format that if statement?&lt;BR /&gt;does anyone have an example?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2024 07:57:21 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/How-to-compose-a-condition-with-an-if-statement-in-workflows/m-p/254271#M1760</guid>
      <dc:creator>wouterdt</dc:creator>
      <dc:date>2024-08-27T07:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to compose a condition with an if statement in workflows</title>
      <link>https://community.dynatrace.com/t5/Automations/How-to-compose-a-condition-with-an-if-statement-in-workflows/m-p/254356#M1762</link>
      <description>&lt;P&gt;If your value is already a boolean, I don't think you need to use the "&lt;EM&gt;== true&lt;/EM&gt;" part. Also make sure your result is being returned in the previous step.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Something like this should work:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Eric_Yu_0-1724795865894.png" style="width: 842px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/22053i704431572A7681F1/image-dimensions/842x342?v=v2" width="842" height="342" role="button" title="Eric_Yu_0-1724795865894.png" alt="Eric_Yu_0-1724795865894.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2024 21:58:21 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/How-to-compose-a-condition-with-an-if-statement-in-workflows/m-p/254356#M1762</guid>
      <dc:creator>Eric_Yu</dc:creator>
      <dc:date>2024-08-27T21:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to compose a condition with an if statement in workflows</title>
      <link>https://community.dynatrace.com/t5/Automations/How-to-compose-a-condition-with-an-if-statement-in-workflows/m-p/254368#M1763</link>
      <description>&lt;P&gt;Currently it runs with the {{ variable == true }} without issue so you can use the true part&lt;/P&gt;&lt;P&gt;question is on on how to introduce a second variable and only proceed when 2 variables match a condition.&lt;BR /&gt;The&amp;nbsp; Jinja2 doc talks about if statements but i don't understand how to introduce them in this context.&lt;BR /&gt;The Dynatrace doc mentions if as well but does not show an example.&lt;BR /&gt;Tried stuff like this without much luck&lt;/P&gt;&lt;P&gt;{%if result('action1').production == true %}&lt;BR /&gt;{%if result('action2').priority == "P1" %}&lt;BR /&gt;{% endif %}&lt;BR /&gt;{% endif %}&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 05:51:45 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/How-to-compose-a-condition-with-an-if-statement-in-workflows/m-p/254368#M1763</guid>
      <dc:creator>wouterdt</dc:creator>
      <dc:date>2024-08-28T05:51:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to compose a condition with an if statement in workflows</title>
      <link>https://community.dynatrace.com/t5/Automations/How-to-compose-a-condition-with-an-if-statement-in-workflows/m-p/254709#M1777</link>
      <description>&lt;P&gt;The custom condition field is essentially already wrapped in an "if" statement and you only provide the condition, as the action and else block are predefined.&lt;BR /&gt;As for combining multiple conditions, you'd use and, or and brackets () if needed.&lt;BR /&gt;&lt;A href="https://jinja.palletsprojects.com/en/3.0.x/templates/#logic" target="_blank"&gt;Template Designer Documentation — Jinja Documentation (3.0.x) (palletsprojects.com)&lt;/A&gt;&lt;BR /&gt;example:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;{{ result('action1').production == true and result('action2').priority == "P1" }}&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2024 12:19:36 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/How-to-compose-a-condition-with-an-if-statement-in-workflows/m-p/254709#M1777</guid>
      <dc:creator>ChristopherHejl</dc:creator>
      <dc:date>2024-09-02T12:19:36Z</dc:date>
    </item>
  </channel>
</rss>

