<?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: Javascript action to write result of DQL query to file in a workflow, and then load that data in a Notebook via Javascript act in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Javascript-action-to-write-result-of-DQL-query-to-file-in-a/m-p/277511#M2101</link>
    <description>&lt;P&gt;Thank you Marco. &amp;nbsp;How do you export the result into a file (assuming this is SaaS) with data spanning the last 3 months, and then have a notebook or dashboard load those results from the file into tables and charts at a later time? &amp;nbsp; &amp;nbsp;For example, the workflow would kick off at 12 AM and write the results to a file. &amp;nbsp;Then, users can later view the results in a dashboard or notebook.&lt;/P&gt;</description>
    <pubDate>Mon, 19 May 2025 14:19:50 GMT</pubDate>
    <dc:creator>FShimaya</dc:creator>
    <dc:date>2025-05-19T14:19:50Z</dc:date>
    <item>
      <title>Javascript action to write result of DQL query to file in a workflow, and then load that data in a Notebook via Javascript action?</title>
      <link>https://community.dynatrace.com/t5/DQL/Javascript-action-to-write-result-of-DQL-query-to-file-in-a/m-p/277248#M2082</link>
      <description>&lt;P&gt;Is it possible to create a workflow where the result of a DQL query is passed to a Javascript action, and that action writes the result to a file somewhere (assume this is SaaS), and then a Notebook displays the data from that file via a javascript action?&amp;nbsp; The usecase is to have the workflow query a lot of data at night, write it to a file, and then have it available for viewing in a Notebook.&amp;nbsp; I'd like to see sample code if this is possible.&lt;/P&gt;</description>
      <pubDate>Thu, 15 May 2025 07:00:29 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Javascript-action-to-write-result-of-DQL-query-to-file-in-a/m-p/277248#M2082</guid>
      <dc:creator>FShimaya</dc:creator>
      <dc:date>2025-05-15T07:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: Javascript action to write result of DQL query to file in a workflow, and then load that data in a Notebook via Javascript act</title>
      <link>https://community.dynatrace.com/t5/DQL/Javascript-action-to-write-result-of-DQL-query-to-file-in-a/m-p/277422#M2094</link>
      <description>&lt;P&gt;When a DQL query is executed as part of a workflow, the results are already stored as part of the workflow execution. You can just use the existing 'executionsClient' module from the automation-client SDK within a 'Code' tile to do the following:&lt;/P&gt;&lt;P&gt;1. Get the execution ID from the most recent execution of your workflow&lt;/P&gt;&lt;P&gt;2. Use the execution ID from step 1 above to then retrieve the results from the specific workflow step within that particular execution.&lt;/P&gt;&lt;P&gt;The resulting code looks like this:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;import { executionsClient } from "@dynatrace-sdk/client-automation";

export default async function () {

  // Get the last successful execution of the workflow
  const workflow_executions = await executionsClient.getExecutions({
    workflow: "&amp;lt;workflow_id_here&amp;gt;",
    ordering: "-endedAt",
    state: "SUCCESS"
  });
  const last_execution = workflow_executions.results[0].id;
    
  // fetch the result(s) from the workflow task
  const myData = await executionsClient.getTaskExecutionResult({
    executionId: last_execution,
    id: "&amp;lt;step_name_here&amp;gt;"
    });
  
  return myData;

}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 May 2025 22:30:29 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Javascript-action-to-write-result-of-DQL-query-to-file-in-a/m-p/277422#M2094</guid>
      <dc:creator>marco_irmer</dc:creator>
      <dc:date>2025-05-16T22:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: Javascript action to write result of DQL query to file in a workflow, and then load that data in a Notebook via Javascript act</title>
      <link>https://community.dynatrace.com/t5/DQL/Javascript-action-to-write-result-of-DQL-query-to-file-in-a/m-p/277511#M2101</link>
      <description>&lt;P&gt;Thank you Marco. &amp;nbsp;How do you export the result into a file (assuming this is SaaS) with data spanning the last 3 months, and then have a notebook or dashboard load those results from the file into tables and charts at a later time? &amp;nbsp; &amp;nbsp;For example, the workflow would kick off at 12 AM and write the results to a file. &amp;nbsp;Then, users can later view the results in a dashboard or notebook.&lt;/P&gt;</description>
      <pubDate>Mon, 19 May 2025 14:19:50 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Javascript-action-to-write-result-of-DQL-query-to-file-in-a/m-p/277511#M2101</guid>
      <dc:creator>FShimaya</dc:creator>
      <dc:date>2025-05-19T14:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: Javascript action to write result of DQL query to file in a workflow, and then load that data in a Notebook via Javascript act</title>
      <link>https://community.dynatrace.com/t5/DQL/Javascript-action-to-write-result-of-DQL-query-to-file-in-a/m-p/277531#M2104</link>
      <description>&lt;P&gt;Dynatrace SaaS doesn't currently provide any built-in storage of 'files' in the traditional sense. It sounds as though you are looking to visualize workflow output across several months, so perhaps your workflow could use the 'S3: Put Object' action to store the data in an S3 bucket, and then you can retrieve the data at a later date via another workflow or via a code tile within your notebook/dashboard.&lt;/P&gt;</description>
      <pubDate>Mon, 19 May 2025 19:15:52 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Javascript-action-to-write-result-of-DQL-query-to-file-in-a/m-p/277531#M2104</guid>
      <dc:creator>marco_irmer</dc:creator>
      <dc:date>2025-05-19T19:15:52Z</dc:date>
    </item>
  </channel>
</rss>

