# DQL/DPL Transposing Arrays into lines?

**URL:** <https://community.dynatrace.com/t/dql-dpl-transposing-arrays-into-lines/42992>\
**Category:** Developer Q&A Forum\
**Tags:** dql, workflows\
**Created:** [December 2, 2023, 2:49pm UTC](https://community.dynatrace.com/t/dql-dpl-transposing-arrays-into-lines/42992 "2023-12-02T14:49:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![r\_weber](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/r_weber/32/24884_2.png) [@r\_weber](https://community.dynatrace.com/u/r_weber)\
**Post date:** [December 2, 2023, 2:49pm UTC](https://community.dynatrace.com/t/dql-dpl-transposing-arrays-into-lines/42992/1 "2023-12-02T14:49:35Z")

</div>

Hey,

I just came across a interesting use case that I’m trying to solve with native DQL/DPL.

Say, I have a bizevent captured content that looks like this:

```markup
{
  "jobs": [
    {"name": "job1", "result": "OK", "start": <time>, "end": <time> }
    {"name": "job2", "result": "OK", "start": <time>, "end": <time> }
    {"name": "job3", "result": "OK", "start": <time>, "end": <time> }
    {"name": "job4", "result": "OK", "start": <time>, "end": <time> }
  ]
}

```

So with one bizevent I get the status of a (unknown) list of jobs, which I actually want to treat independently (create metrics from, as individual bizevents, alert, etc…)

I know that DQL is a table pipe/stream processing so the above content would always be “one row” in this stream.  
I’m looking for a creative way how I could extract/action on every list in the “jobs” array.

The only idea I had so far was to create a workflow with a bizevent trigger, that then processes the JSON content and iterates over the array and then ingests a separate bizevent for every item via API (or built in functions if available)?

Do you maybe have more creative ides?

Thanks!

---

<div class="post-metadata">

**Author:** ![sinisa\_zubic](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/sinisa_zubic/32/32498_2.png) [@sinisa\_zubic](https://community.dynatrace.com/u/sinisa_zubic)\
**Post date:** [December 4, 2023, 8:29am UTC](https://community.dynatrace.com/t/dql-dpl-transposing-arrays-into-lines/42992/2 "2023-12-04T08:29:20Z")

</div>

Hi&nbsp;[@r\_weber](https://community.dynatrace.com/user/35901)

Do you want the jobs in grail to be stored as seperate record, or is it OK just when querying the bizevents to have the result as a list of jobs?

Because you can easily transform the json into a list of records

```markup
data record(content="""{
  "jobs": [
    {"name": "job1", "result": "OK", "start": <time>, "end": <time> }
    {"name": "job2", "result": "OK", "start": <time>, "end": <time> }
    {"name": "job3", "result": "OK", "start": <time>, "end": <time> }
    {"name": "job4", "result": "OK", "start": <time>, "end": <time> }
  ]
}""")
| parse content, "JSON(strict=false):json"
| expand job=json[jobs]

```

Best,  
Sini

---

<div class="post-metadata">

**Author:** ![r\_weber](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/r_weber/32/24884_2.png) [@r\_weber](https://community.dynatrace.com/u/r_weber)\
**Post date:** [December 4, 2023, 7:23pm UTC](https://community.dynatrace.com/t/dql-dpl-transposing-arrays-into-lines/42992/3 "2023-12-04T19:23:34Z")

</div>

Thanks&nbsp;[@sinisa\_zubic](https://community.dynatrace.com/user/38283)&nbsp;,

that expand command is golden. Wondering why I didn’t stumble across it while reading the documentation.  
I might still want to create individual BizEvents out of one, but for the initial trials this should work!

Cheers,  
Reinhard
