<?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 How do I format a DQL Query into Adaptive Cards properly - Workflows in Developer Q&amp;A Forum</title>
    <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/How-do-I-format-a-DQL-Query-into-Adaptive-Cards-properly/m-p/249281#M981</link>
    <description>&lt;P&gt;From a high-level point of view, I need a workflow which grabs a DQL query of disk free as a percentage and then sends that as a Teams message.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I have as my first flow (the DQL query)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries percent = avg(dt.host.disk.used.percent), by: { dt.entity.host, dt.entity.disk }, filter: { in(dt.entity.host, classicEntitySelector("type(host),tag(\"Business Unit:FINANCE_DEPT\")")) }
| fields util = arrayAvg(percent), entityName(dt.entity.host)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It will then output this in a raw JSON format with the function get_disk_stats_title.records&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[{"util":37.81379436933137,"dt.entity.host.name":"exampleserver_1"},{"util":0.48663042982483673,"dt.entity.host.name":"WNCDKS01.corp.net"},{"util":49.254119519423064,"dt.entity.host.name":"WNBX103.corp.net"},{"util":37.62645628433896,"dt.entity.host.name":"exampleserver_4"},{"util":69.18935581114691,"dt.entity.host.name":"exampleserver_5"},{"util":71.16928194761574,"dt.entity.host.name":"exampleserver_6"},{"util":40.62837394704024,"dt.entity.host.name":"exampleserver_7"}]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Im trying to use the adaptive cards but not sure how to format it to generate a human-readable card?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 27 Jun 2024 11:50:43 GMT</pubDate>
    <dc:creator>badgerfifteen</dc:creator>
    <dc:date>2024-06-27T11:50:43Z</dc:date>
    <item>
      <title>How do I format a DQL Query into Adaptive Cards properly - Workflows</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/How-do-I-format-a-DQL-Query-into-Adaptive-Cards-properly/m-p/249281#M981</link>
      <description>&lt;P&gt;From a high-level point of view, I need a workflow which grabs a DQL query of disk free as a percentage and then sends that as a Teams message.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I have as my first flow (the DQL query)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries percent = avg(dt.host.disk.used.percent), by: { dt.entity.host, dt.entity.disk }, filter: { in(dt.entity.host, classicEntitySelector("type(host),tag(\"Business Unit:FINANCE_DEPT\")")) }
| fields util = arrayAvg(percent), entityName(dt.entity.host)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It will then output this in a raw JSON format with the function get_disk_stats_title.records&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[{"util":37.81379436933137,"dt.entity.host.name":"exampleserver_1"},{"util":0.48663042982483673,"dt.entity.host.name":"WNCDKS01.corp.net"},{"util":49.254119519423064,"dt.entity.host.name":"WNBX103.corp.net"},{"util":37.62645628433896,"dt.entity.host.name":"exampleserver_4"},{"util":69.18935581114691,"dt.entity.host.name":"exampleserver_5"},{"util":71.16928194761574,"dt.entity.host.name":"exampleserver_6"},{"util":40.62837394704024,"dt.entity.host.name":"exampleserver_7"}]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Im trying to use the adaptive cards but not sure how to format it to generate a human-readable card?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 11:50:43 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/How-do-I-format-a-DQL-Query-into-Adaptive-Cards-properly/m-p/249281#M981</guid>
      <dc:creator>badgerfifteen</dc:creator>
      <dc:date>2024-06-27T11:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: How do I format a DQL Query into Adaptive Cards properly - Workflows</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/How-do-I-format-a-DQL-Query-into-Adaptive-Cards-properly/m-p/249366#M984</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/67521"&gt;@badgerfifteen&lt;/a&gt;, I'm not sure I fully understand you question, but I guess it's about how to use the AdaptiveCards SDK in Workflows, is that right? If so,&amp;nbsp;&lt;SPAN&gt;you can load it from a JavaScript CDN like esm.sh:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;import * as AdaptiveCards from 'https://esm.sh/adaptivecards@3.0.4';

export default async function ({ execution_id }) {
  const adaptiveCard = new AdaptiveCards.AdaptiveCard();
  // ...
}&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN&gt;You just have to make sure that esm.sh is&amp;nbsp;&lt;A href="https://developer.dynatrace.com/preview/develop/functions/allow-outbound-connections/" target="_self" rel="noopener noreferrer"&gt;allow-listed from your tenant&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2024 08:05:31 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/How-do-I-format-a-DQL-Query-into-Adaptive-Cards-properly/m-p/249366#M984</guid>
      <dc:creator>educampver</dc:creator>
      <dc:date>2024-06-28T08:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: How do I format a DQL Query into Adaptive Cards properly - Workflows</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/How-do-I-format-a-DQL-Query-into-Adaptive-Cards-properly/m-p/249619#M990</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/67521"&gt;@badgerfifteen&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope the solution above solution worked for you, if so, please 'accept as solution', to help us close this community question.&lt;/P&gt;
&lt;P&gt;Thanks, Penny&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 06:33:27 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/How-do-I-format-a-DQL-Query-into-Adaptive-Cards-properly/m-p/249619#M990</guid>
      <dc:creator>PennyScully</dc:creator>
      <dc:date>2024-07-02T06:33:27Z</dc:date>
    </item>
  </channel>
</rss>

