<?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 condition matching in Workflow in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/condition-matching-in-Workflow/m-p/242342#M810</link>
    <description>&lt;P&gt;I am trying to create a Workflow that responds to a DQL query where it seems like the metric is occasionally showing an empty records array.&lt;/P&gt;&lt;P&gt;I would like to trigger some specific action if the `"records": [],` is present.&lt;/P&gt;&lt;P&gt;It seems like the fundamental issue is the Workflow condition matcher is not recognizing this syntax:&lt;/P&gt;&lt;P&gt;```&lt;BR /&gt;{{ result("httpendpointsuccess").records == [] }}&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Error evaluating custom condition - Undefined variables in '{{ result("httpendpointsuccess").records }}': records&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;It is happy with this syntax however:&lt;/P&gt;&lt;P&gt;```&lt;BR /&gt;{{ result("httpendpointsuccess") }}&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;&lt;P&gt;In the Result analysis, it purports that result("httpendpointsuccess") returns two items, "0" and "1". (Which is true because these represent looping through a two-item list for AWS accounts)&lt;/P&gt;&lt;P&gt;Item 0 looks like this:&lt;/P&gt;&lt;P&gt;```&lt;BR /&gt;{&lt;BR /&gt;"types": [],&lt;BR /&gt;"records": [], # THIS IS THE PROBLEM I WANT TO TAKE ACTION ON&lt;BR /&gt;"metadata": {&lt;BR /&gt;"grail": {&lt;/P&gt;&lt;P&gt;"scannedDataPoints": 0,&lt;BR /&gt;"executionTimeMilliseconds": 27&lt;BR /&gt;},&lt;BR /&gt;"metrics": [&lt;BR /&gt;{&lt;BR /&gt;"fieldName": "deliveryToHttpEndpointSuccessByAccountIdDeliveryStreamNameRegion",&lt;BR /&gt;"metric.key": "cloud.aws.firehose.deliveryToHttpEndpointSuccessByAccountIdDeliveryStreamNameRegion"&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;Item 1 looks like this:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;```&lt;BR /&gt;{&lt;BR /&gt;"types": [&lt;BR /&gt;{&lt;BR /&gt;"mappings": {&lt;BR /&gt;"interval": {&lt;BR /&gt;"type": "duration"&lt;BR /&gt;},&lt;BR /&gt;"timeframe": {&lt;BR /&gt;"type": "timeframe"&lt;BR /&gt;},&lt;BR /&gt;"aws.region": {&lt;BR /&gt;"type": "string"&lt;BR /&gt;},&lt;BR /&gt;"aws.account.id": {&lt;BR /&gt;"type": "string"&lt;BR /&gt;},&lt;BR /&gt;"deliverystreamname": {&lt;BR /&gt;"type": "string"&lt;BR /&gt;},&lt;BR /&gt;"dt.entity.cloud&lt;img class="lia-deferred-image lia-image-emoji" src="https://community.dynatrace.com/html/@F9676CCDE08B8746467ACFFDC4C9827E/images/emoticons/aws.png" alt=":aws:" title=":aws:" /&gt;region": {&lt;BR /&gt;"type": "string"&lt;BR /&gt;},&lt;BR /&gt;"dt.entity.cloud&lt;img class="lia-deferred-image lia-image-emoji" src="https://community.dynatrace.com/html/@F9676CCDE08B8746467ACFFDC4C9827E/images/emoticons/aws.png" alt=":aws:" title=":aws:" /&gt;account": {&lt;BR /&gt;"type": "string"&lt;BR /&gt;},&lt;BR /&gt;"deliveryToHttpEndpointSuccessByAccountIdDeliveryStreamNameRegion": {&lt;BR /&gt;"type": "array",&lt;BR /&gt;"types": [&lt;BR /&gt;{&lt;BR /&gt;"mappings": {&lt;BR /&gt;"element": {&lt;BR /&gt;"type": "double"&lt;BR /&gt;}&lt;BR /&gt;},&lt;BR /&gt;"indexRange": [&lt;BR /&gt;0,&lt;BR /&gt;120&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;},&lt;BR /&gt;"indexRange": [&lt;BR /&gt;0,&lt;BR /&gt;0&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;],&lt;BR /&gt;"records": [&lt;BR /&gt;{&lt;BR /&gt;"interval": "60000000000",&lt;BR /&gt;"timeframe": {&lt;BR /&gt;"end": "2024-04-10T16:22:00.000Z",&lt;BR /&gt;"start": "2024-04-10T14:21:00.000Z"&lt;BR /&gt;},&lt;/P&gt;&lt;P&gt;"deliveryToHttpEndpointSuccessByAccountIdDeliveryStreamNameRegion": [&lt;BR /&gt;1,&lt;BR /&gt;1,&lt;BR /&gt;1,&lt;BR /&gt;1,&lt;BR /&gt;null,&lt;BR /&gt;&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;],&lt;BR /&gt;"metadata": {&lt;BR /&gt;"grail": {&lt;BR /&gt;&lt;BR /&gt;"scannedDataPoints": 151,&lt;BR /&gt;"executionTimeMilliseconds": 32&lt;BR /&gt;},&lt;BR /&gt;"metrics": [&lt;BR /&gt;{&lt;BR /&gt;"fieldName": "deliveryToHttpEndpointSuccessByAccountIdDeliveryStreamNameRegion",&lt;BR /&gt;"metric.key": "cloud.aws.firehose.deliveryToHttpEndpointSuccessByAccountIdDeliveryStreamNameRegion"&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;My fundamental quest is to match only when the `"records": []`, could I get some help with the condition matching syntax in the Workflow?&lt;/P&gt;</description>
    <pubDate>Wed, 10 Apr 2024 16:49:37 GMT</pubDate>
    <dc:creator>roberto_camp1</dc:creator>
    <dc:date>2024-04-10T16:49:37Z</dc:date>
    <item>
      <title>condition matching in Workflow</title>
      <link>https://community.dynatrace.com/t5/DQL/condition-matching-in-Workflow/m-p/242342#M810</link>
      <description>&lt;P&gt;I am trying to create a Workflow that responds to a DQL query where it seems like the metric is occasionally showing an empty records array.&lt;/P&gt;&lt;P&gt;I would like to trigger some specific action if the `"records": [],` is present.&lt;/P&gt;&lt;P&gt;It seems like the fundamental issue is the Workflow condition matcher is not recognizing this syntax:&lt;/P&gt;&lt;P&gt;```&lt;BR /&gt;{{ result("httpendpointsuccess").records == [] }}&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Error evaluating custom condition - Undefined variables in '{{ result("httpendpointsuccess").records }}': records&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;It is happy with this syntax however:&lt;/P&gt;&lt;P&gt;```&lt;BR /&gt;{{ result("httpendpointsuccess") }}&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;&lt;P&gt;In the Result analysis, it purports that result("httpendpointsuccess") returns two items, "0" and "1". (Which is true because these represent looping through a two-item list for AWS accounts)&lt;/P&gt;&lt;P&gt;Item 0 looks like this:&lt;/P&gt;&lt;P&gt;```&lt;BR /&gt;{&lt;BR /&gt;"types": [],&lt;BR /&gt;"records": [], # THIS IS THE PROBLEM I WANT TO TAKE ACTION ON&lt;BR /&gt;"metadata": {&lt;BR /&gt;"grail": {&lt;/P&gt;&lt;P&gt;"scannedDataPoints": 0,&lt;BR /&gt;"executionTimeMilliseconds": 27&lt;BR /&gt;},&lt;BR /&gt;"metrics": [&lt;BR /&gt;{&lt;BR /&gt;"fieldName": "deliveryToHttpEndpointSuccessByAccountIdDeliveryStreamNameRegion",&lt;BR /&gt;"metric.key": "cloud.aws.firehose.deliveryToHttpEndpointSuccessByAccountIdDeliveryStreamNameRegion"&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;Item 1 looks like this:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;```&lt;BR /&gt;{&lt;BR /&gt;"types": [&lt;BR /&gt;{&lt;BR /&gt;"mappings": {&lt;BR /&gt;"interval": {&lt;BR /&gt;"type": "duration"&lt;BR /&gt;},&lt;BR /&gt;"timeframe": {&lt;BR /&gt;"type": "timeframe"&lt;BR /&gt;},&lt;BR /&gt;"aws.region": {&lt;BR /&gt;"type": "string"&lt;BR /&gt;},&lt;BR /&gt;"aws.account.id": {&lt;BR /&gt;"type": "string"&lt;BR /&gt;},&lt;BR /&gt;"deliverystreamname": {&lt;BR /&gt;"type": "string"&lt;BR /&gt;},&lt;BR /&gt;"dt.entity.cloud&lt;img class="lia-deferred-image lia-image-emoji" src="https://community.dynatrace.com/html/@F9676CCDE08B8746467ACFFDC4C9827E/images/emoticons/aws.png" alt=":aws:" title=":aws:" /&gt;region": {&lt;BR /&gt;"type": "string"&lt;BR /&gt;},&lt;BR /&gt;"dt.entity.cloud&lt;img class="lia-deferred-image lia-image-emoji" src="https://community.dynatrace.com/html/@F9676CCDE08B8746467ACFFDC4C9827E/images/emoticons/aws.png" alt=":aws:" title=":aws:" /&gt;account": {&lt;BR /&gt;"type": "string"&lt;BR /&gt;},&lt;BR /&gt;"deliveryToHttpEndpointSuccessByAccountIdDeliveryStreamNameRegion": {&lt;BR /&gt;"type": "array",&lt;BR /&gt;"types": [&lt;BR /&gt;{&lt;BR /&gt;"mappings": {&lt;BR /&gt;"element": {&lt;BR /&gt;"type": "double"&lt;BR /&gt;}&lt;BR /&gt;},&lt;BR /&gt;"indexRange": [&lt;BR /&gt;0,&lt;BR /&gt;120&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;},&lt;BR /&gt;"indexRange": [&lt;BR /&gt;0,&lt;BR /&gt;0&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;],&lt;BR /&gt;"records": [&lt;BR /&gt;{&lt;BR /&gt;"interval": "60000000000",&lt;BR /&gt;"timeframe": {&lt;BR /&gt;"end": "2024-04-10T16:22:00.000Z",&lt;BR /&gt;"start": "2024-04-10T14:21:00.000Z"&lt;BR /&gt;},&lt;/P&gt;&lt;P&gt;"deliveryToHttpEndpointSuccessByAccountIdDeliveryStreamNameRegion": [&lt;BR /&gt;1,&lt;BR /&gt;1,&lt;BR /&gt;1,&lt;BR /&gt;1,&lt;BR /&gt;null,&lt;BR /&gt;&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;],&lt;BR /&gt;"metadata": {&lt;BR /&gt;"grail": {&lt;BR /&gt;&lt;BR /&gt;"scannedDataPoints": 151,&lt;BR /&gt;"executionTimeMilliseconds": 32&lt;BR /&gt;},&lt;BR /&gt;"metrics": [&lt;BR /&gt;{&lt;BR /&gt;"fieldName": "deliveryToHttpEndpointSuccessByAccountIdDeliveryStreamNameRegion",&lt;BR /&gt;"metric.key": "cloud.aws.firehose.deliveryToHttpEndpointSuccessByAccountIdDeliveryStreamNameRegion"&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;My fundamental quest is to match only when the `"records": []`, could I get some help with the condition matching syntax in the Workflow?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2024 16:49:37 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/condition-matching-in-Workflow/m-p/242342#M810</guid>
      <dc:creator>roberto_camp1</dc:creator>
      <dc:date>2024-04-10T16:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: condition matching in Workflow</title>
      <link>https://community.dynatrace.com/t5/DQL/condition-matching-in-Workflow/m-p/242595#M819</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/67600"&gt;@roberto_camp1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;Your syntax {{ result("httpendpointsuccess").records == [] }} in itself is correct, but only if a single object is returned. In your case you need to specify in which object the "result" field you want to check .Here the syntax will depend on what format your two objects are returned in, if in the form of a list it can look like this: {{ result("httpendpointsuccess")[0].records == [] }}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Bests&lt;BR /&gt;Michal&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2024 10:46:25 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/condition-matching-in-Workflow/m-p/242595#M819</guid>
      <dc:creator>MichalOlszewski</dc:creator>
      <dc:date>2024-04-15T10:46:25Z</dc:date>
    </item>
  </channel>
</rss>

