# Parse JSON array from DQL in workflows

**URL:** <https://community.dynatrace.com/t/parse-json-array-from-dql-in-workflows/52991>\
**Category:** Automations\
**Tags:** json, workflows, javascript\
**Created:** [August 18, 2025, 9:37am UTC](https://community.dynatrace.com/t/parse-json-array-from-dql-in-workflows/52991 "2025-08-18T09:37:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jan\_VanBelle](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/jan_vanbelle/32/34174_2.png) [@Jan\_VanBelle](https://community.dynatrace.com/u/Jan_VanBelle)\
**Post date:** [August 18, 2025, 9:37am UTC](https://community.dynatrace.com/t/parse-json-array-from-dql-in-workflows/52991/1 "2025-08-18T09:37:10Z")

</div>

Hello,

We’re trying to do something with records which have been open for a period of time.

So I’ve created a workflow with (for now: ) 2 steps:

- fetch the data via a DQL query --\> works fine
- parse the DQL output and find out what to do with it --\> gives me headaches

The problem I seem to face is: the array I get from DQL seems to be an object, but all records within are treated as strings

the code:

```javascript
// optional import of sdk modules
import { execution } from '@dynatrace-sdk/automation-utils';

export default async function ({ execution_id }) {
  // your code goes here
  // e.g. get the current execution
  console.log("wait for log running problems");

  const exe = await execution(execution_id);
  const problems_array = await exe.result("fetch_long_running_problems")

  console.log("problems_data: " + typeof(problems_array));
  //console.log(problems_array);

  for (const problem_record in problems_array.records) {
    console.log("* (" + typeof(problem_record) + ") : " + problem_record); 
  }

  // not yet important for now
  return { problems_array };
}

```

a snippet from the JSON I get:

```javascript
[
  {
    timestamp: "2025-08-18T03:08:03.345000000Z",
    display_id: "P-25085838",
    "event.name": "Process unavailable",
    entity_tags: [
      "Application:XXX",
      "Environment:400DEV",
      "ExeName:RI.demo.B*B.Sif.Signal*L.Daemons.Dispatcher.exe",
      "HostName:servername",
      "Process Group Availability Monitored:true",
      "ProcessType:Daemon"
    ],
    "event.description": "# Process unavailable\n" +
      "\n" +
      "The problem **affects 1 entity** overall.\n"
  },
  {
    timestamp: "2025-08-18T07:44:47.835000000Z",
    display_id: "P-25086167",
    "event.name": "RI - PENORCH - demo NServiceBus Handlers Service is in undesirable (stopped) state",
    entity_tags: [
      "Application:XXX",
      "Environment:200REL",
      "HostName:server-url"
    ],
    "event.description": "# RI - PENORCH - demo NServiceBus Handlers Service is in undesirable (stopped) state\n" +
      "\n" +
      "The problem **affects 1 entity** overall.\n" 
  },
  {
    timestamp: "2025-08-18T03:42:14.394000000Z",
    display_id: "P-25086104",
    "event.name": "200REL - NSB errors for NPR.B2Bdemo",
    entity_tags: ["Environment:200REL", "Queues:NServiceBus", "Team:XXX"],
    "event.description": "# 200REL - NSB errors for NPR.B2Bdemo\n" +
      "\n" +
      "The problem **affects 1 entity** overall.\n"
  },
  {
    timestamp: "2025-08-18T08:50:23.818000000Z",
    display_id: "P-25086103",
    "event.name": "200REL - NSB errors for NPR.demo_SubNotifications",
    entity_tags: ["Environment:200REL", "Queues:NServiceBus", "Team:XXX"],
    "event.description": "# 200REL - NSB errors for NPR.demo_SubNotifications\n" +
      "\n" +
      "The problem **affects 1 entity** overall.\n"
  }
]

```

… but the output I get for now is:

```markup
wait for log running problems
problems_data: object
* (string) : 0
* (string) : 1
* (string) : 2
* (string) : 3
* (string) : 4
* (string) : 5
* (string) : 6
* (string) : 7
* (string) : 8

```

Could someone give a hint how to tackle this?

Thanks,

Jan

---

<div class="post-metadata">

**Author:** ![izabelarokita](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/izabelarokita/32/41812_2.png) [@izabelarokita](https://community.dynatrace.com/u/izabelarokita)\
**Post date:** [December 15, 2025, 10:48am UTC](https://community.dynatrace.com/t/parse-json-array-from-dql-in-workflows/52991/2 "2025-12-15T10:48:49Z")

</div>

Hey&nbsp;[@Jan\_VanBelle](https://community.dynatrace.com/user/25081)&nbsp;,

I just wanted to check in and see if you still need help with this. If so, I’d be happy to look into it for you! 😊  
Please let me know what works best for you.
