<?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 get JSON in Workflows and work on it in the next task in Automations</title>
    <link>https://community.dynatrace.com/t5/Automations/How-get-JSON-in-Workflows-and-work-on-it-in-the-next-task/m-p/274107#M2100</link>
    <description>&lt;P&gt;Hey all, I am following up on this thread. I am working on creating a workflow that automatically queries the Dynatrace Dashboards API. That will get a list of dashboards and their respective IDs. I want to then take it and get all the dashboard JSON files to then upload them to gitlab.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I am currently getting the full list of dashboards, but I am having trouble taking that "dashboards.json" file and passing it to the next task. I have uploaded the json in the result in the following task. I have added a screenshot here. Let me know if anyone else has tried to do this!&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="trevordconsult_0-1743521466062.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/27326iF9C68CB66807C4A4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="trevordconsult_0-1743521466062.png" alt="trevordconsult_0-1743521466062.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 01 Apr 2025 15:31:19 GMT</pubDate>
    <dc:creator>trevordconsult</dc:creator>
    <dc:date>2025-04-01T15:31:19Z</dc:date>
    <item>
      <title>How get JSON in Workflows and work on it in the next task</title>
      <link>https://community.dynatrace.com/t5/Automations/How-get-JSON-in-Workflows-and-work-on-it-in-the-next-task/m-p/241645#M2098</link>
      <description>&lt;P&gt;Hello, good day, I am starting to work with the workflows, in the example that I am building I make an http request, which results in a JSON file, which is what interests me since it brings all the data I need, my question is how can I get that json and work on it in the next task, I was reviewing the documentation and I see a result function but I can't quite understand how it works, I don't know if anyone has a similar example, thank you very much in advance&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 10:00:56 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/How-get-JSON-in-Workflows-and-work-on-it-in-the-next-task/m-p/241645#M2098</guid>
      <dc:creator>Jorge3229</dc:creator>
      <dc:date>2024-04-03T10:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: Workflows</title>
      <link>https://community.dynatrace.com/t5/Automations/How-get-JSON-in-Workflows-and-work-on-it-in-the-next-task/m-p/241667#M2099</link>
      <description>&lt;P&gt;Hola Jorge, let me see if I can help a bit.&lt;/P&gt;&lt;P&gt;You can access the results of the previous steps using the following expressions:&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.dynatrace.com/docs/shortlink/automation-workflow-expression-reference#result" target="_self"&gt;https://docs.dynatrace.com/docs/shortlink/automation-workflow-expression-reference#result&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can use this syntaxis inside the options and parameters of the following steps.&lt;/P&gt;&lt;P&gt;If the returned object has attributes or more properties you can access them as well using something like:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;{{ result('task_1').foo }}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Works as well when working with JSON objects. Most of the tasks return a JSON result object.&lt;/P&gt;&lt;P&gt;If you need to work with the previous results inside a Javascript task and code, you can work with something like in this example:&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.dynatrace.com/docs/shortlink/davis-workflow-integration#evaluate" target="_self"&gt;https://docs.dynatrace.com/docs/shortlink/davis-workflow-integration#evaluate&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see you can store the resulting object from a previous task, or even create a new array to store the whole results. In that example they use:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;const TASK_ID = 'predict_disk_capacity'; //here you put the name of the previous task&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;const predResult = await exe.result(TASK_ID); //store the whole result in a new variable&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;const result = predResult['result']; //a new variable to store only the result part&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Then you can work with&amp;nbsp;&lt;STRONG&gt;result&lt;/STRONG&gt; to traverse it or access any particular value.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Jose David.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2024 21:45:56 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/How-get-JSON-in-Workflows-and-work-on-it-in-the-next-task/m-p/241667#M2099</guid>
      <dc:creator>jose_araya</dc:creator>
      <dc:date>2024-04-02T21:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: How get JSON in Workflows and work on it in the next task</title>
      <link>https://community.dynatrace.com/t5/Automations/How-get-JSON-in-Workflows-and-work-on-it-in-the-next-task/m-p/274107#M2100</link>
      <description>&lt;P&gt;Hey all, I am following up on this thread. I am working on creating a workflow that automatically queries the Dynatrace Dashboards API. That will get a list of dashboards and their respective IDs. I want to then take it and get all the dashboard JSON files to then upload them to gitlab.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I am currently getting the full list of dashboards, but I am having trouble taking that "dashboards.json" file and passing it to the next task. I have uploaded the json in the result in the following task. I have added a screenshot here. Let me know if anyone else has tried to do this!&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="trevordconsult_0-1743521466062.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/27326iF9C68CB66807C4A4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="trevordconsult_0-1743521466062.png" alt="trevordconsult_0-1743521466062.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Apr 2025 15:31:19 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/How-get-JSON-in-Workflows-and-work-on-it-in-the-next-task/m-p/274107#M2100</guid>
      <dc:creator>trevordconsult</dc:creator>
      <dc:date>2025-04-01T15:31:19Z</dc:date>
    </item>
  </channel>
</rss>

