<?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: Workflows - Access data from other tasks in Automations</title>
    <link>https://community.dynatrace.com/t5/Automations/Workflows-Access-data-from-other-tasks/m-p/218958#M68</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/63035"&gt;@Kennedy&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Depending on what you're trying to do, there are a few ways to get event data. If you're using the "Run Javascript" action, you can't use expressions for security reasons. Instead, it's really easy to use the &lt;A href="https://developer.dynatrace.com/reference/sdks/automation-utils/#execution-utilities-examples" target="_blank" rel="noopener"&gt;Automation utils SDK&lt;/A&gt; (check out the docs for examples).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can use expressions if you're using any other action. You can access event data using the &lt;A href="https://www.dynatrace.com/support/help/platform-modules/cloud-automation/workflows/reference#event" target="_self"&gt;event()&lt;/A&gt; expression. And to get results of previous tasks use the &lt;A href="https://www.dynatrace.com/support/help/platform-modules/cloud-automation/workflows/reference#result" target="_blank" rel="noopener"&gt;result()&lt;/A&gt; expression. You can find examples of how to use them in the docs.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Let's say that your first task ("task_1") consumes the event data and returns the results&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;{ hostname: "ABC00001" }&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;In the subsequent DQL tasks ("task_2"), you can access these results like this&lt;/P&gt;
&lt;PRE&gt;fetch events | filter hostname == {{ result("task_1").hostname }}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I hope that helps! Let me know if you need any more assistance.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 26 Jul 2023 07:20:48 GMT</pubDate>
    <dc:creator>michal_zawislak</dc:creator>
    <dc:date>2023-07-26T07:20:48Z</dc:date>
    <item>
      <title>Workflows - Access data from other tasks</title>
      <link>https://community.dynatrace.com/t5/Automations/Workflows-Access-data-from-other-tasks/m-p/218949#M67</link>
      <description>&lt;P&gt;Hi there Dyna fam,&lt;BR /&gt;Currently working on a Workflow to is triggered by a Problem event. We want to access the data in that problem and extract a tag (hostname: ABC00001) that is in "entity_tags" in the json payload of the problem event.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Then in the following task, we want to use that extracted tag VALUE (ABC00001) to run the DQL of it logs.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can we access tag data of the previous task which is the trigger? I see that is possible with {{ }} expressions from this link (&lt;A href="https://www.dynatrace.com/support/help/platform-modules/cloud-automation/workflows/reference" target="_blank" rel="noopener"&gt;Expression reference | Dynatrace Docs&lt;/A&gt;) but not sure how to write that expression or where to write in the task we are running a query.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Any advice would be much appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2023 03:54:46 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Workflows-Access-data-from-other-tasks/m-p/218949#M67</guid>
      <dc:creator>Kennedy</dc:creator>
      <dc:date>2023-07-26T03:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: Workflows - Access data from other tasks</title>
      <link>https://community.dynatrace.com/t5/Automations/Workflows-Access-data-from-other-tasks/m-p/218958#M68</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/63035"&gt;@Kennedy&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Depending on what you're trying to do, there are a few ways to get event data. If you're using the "Run Javascript" action, you can't use expressions for security reasons. Instead, it's really easy to use the &lt;A href="https://developer.dynatrace.com/reference/sdks/automation-utils/#execution-utilities-examples" target="_blank" rel="noopener"&gt;Automation utils SDK&lt;/A&gt; (check out the docs for examples).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can use expressions if you're using any other action. You can access event data using the &lt;A href="https://www.dynatrace.com/support/help/platform-modules/cloud-automation/workflows/reference#event" target="_self"&gt;event()&lt;/A&gt; expression. And to get results of previous tasks use the &lt;A href="https://www.dynatrace.com/support/help/platform-modules/cloud-automation/workflows/reference#result" target="_blank" rel="noopener"&gt;result()&lt;/A&gt; expression. You can find examples of how to use them in the docs.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Let's say that your first task ("task_1") consumes the event data and returns the results&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;{ hostname: "ABC00001" }&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;In the subsequent DQL tasks ("task_2"), you can access these results like this&lt;/P&gt;
&lt;PRE&gt;fetch events | filter hostname == {{ result("task_1").hostname }}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I hope that helps! Let me know if you need any more assistance.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2023 07:20:48 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Workflows-Access-data-from-other-tasks/m-p/218958#M68</guid>
      <dc:creator>michal_zawislak</dc:creator>
      <dc:date>2023-07-26T07:20:48Z</dc:date>
    </item>
  </channel>
</rss>

