# DQL - Recursive array to column extraction

**URL:** <https://community.dynatrace.com/t/dql-recursive-array-to-column-extraction/55166>\
**Category:** DQL\
**Tags:** dql, notebooks\
**Created:** [March 3, 2026, 3:29pm UTC](https://community.dynatrace.com/t/dql-recursive-array-to-column-extraction/55166 "2026-03-03T15:29:04Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yann\_Buccellato](https://avatars.discourse-cdn.com/v4/letter/y/97f17d/32.png) [@Yann\_Buccellato](https://community.dynatrace.com/u/Yann_Buccellato)\
**Post date:** [March 3, 2026, 3:29pm UTC](https://community.dynatrace.com/t/dql-recursive-array-to-column-extraction/55166/1 "2026-03-03T15:29:04Z")

</div>

Hello community,  
I have an array which is build as follow (it contains 2 elements):

```auto
[
{
"text": "Brave new world xx.xx.xxxx of xxxxxx and",
"id": "021(anastasia)",
"index": "0"
},
{
"text": "Brave new world but old",
"id": "404(anastasia)",
"index": "1"
}
]

```

and my goal is to reiterate element extraction from the array to be displayed as columns.  
For instance if I use DQL function arrayElement I can extract one single element and this will be displayed on a single row as follow:

 ![arrayElement.png](https://global.discourse-cdn.com/dynatrace/original/3X/9/d/9d265bee9499109cae3a194dc4dc7929d7fd60aa.png)

What if I want multiple column per each element of the previous array?  
Wish someone can help on this 🙂 [@krzysztof\_hoja](https://community.dynatrace.com/user/25373)

Yann

---

<div class="post-metadata">

**Author:** ![krzysztof\_hoja](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/krzysztof_hoja/32/34625_2.png) [@krzysztof\_hoja](https://community.dynatrace.com/u/krzysztof_hoja)\
**Post date:** [March 3, 2026, 4:20pm UTC](https://community.dynatrace.com/t/dql-recursive-array-to-column-extraction/55166/2 "2026-03-03T16:20:36Z")

</div>

I am not sure if you need this:

```markup
data json:"""{"bla":
[
{
"text": "Brave new world xx.xx.xxxx of xxxxxx and",
"id": "021(anastasia)",
"index": "0"
},
{
"text": "Brave new world but old",
"id": "404(anastasia)",
"index": "1"
}
]}"""

| expand bla

```

 ![2026-03-03_17-13-34.png](https://global.discourse-cdn.com/dynatrace/original/3X/1/3/137f314445a511f2350463c61dcc484f9da0240f.png)

or this (when you know you have just 2 elements)

```markup
| fields e1 = arrayElement(bla,0), e2=arrayElement(bla,1)

```

 ![2026-03-03_17-17-23.png](https://global.discourse-cdn.com/dynatrace/original/2X/0/0397c61a1d1901eda6ae18f49a2bbeaa359e37f5.png)

or this which works for any array:

```markup
| fields bla = concat("\"", iIndex(), "\": ", toString(bla[]))
| fields bla=concat("{",arrayToString(bla, delimiter:","),"}")
| parse bla,"JSON:bla"
| fieldsFlatten bla
| fieldsRemove bla

```

 ![2026-03-03_17-19-15.png](https://global.discourse-cdn.com/dynatrace/original/2X/4/466782e7c74b5121ab77299b0def0db6c040c13b.png)

---

<div class="post-metadata">

**Author:** ![Yann\_Buccellato](https://avatars.discourse-cdn.com/v4/letter/y/97f17d/32.png) [@Yann\_Buccellato](https://community.dynatrace.com/u/Yann_Buccellato)\
**Post date:** [March 3, 2026, 5:49pm UTC](https://community.dynatrace.com/t/dql-recursive-array-to-column-extraction/55166/3 "2026-03-03T17:49:59Z")

</div>

Ei this is the solution: “works for any array” the one at the bottom that you provided.

```markup
| fields bla = concat("\"", iIndex(), "\": ", toString(bla[]))
| fields bla=concat("{",arrayToString(bla, delimiter:","),"}")
| parse bla,"JSON:bla"
| fieldsFlatten bla
| fieldsRemove bla

```

I’m really greteful for you help. You make it look easy 😄

Reading from your other post on the community I understood that I had to build a json but I had no idea on how to do this precisely.

I have few more question if you feel like answering 🙂

1) where did you learn to craft the json via DQL in the way you did?

2) do you think that all these transformation will be supported in OpenPipeline?

3) do you think there are more automated way of reaching this same result via arrayElement() [Logic would be for each array Element create a new flatten colum]? (I experimented a lot with iAny / iIndex() but with no success - when searching from docs to community haven’t found much)

Regards,

Yann

---

<div class="post-metadata">

**Author:** ![krzysztof\_hoja](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/krzysztof_hoja/32/34625_2.png) [@krzysztof\_hoja](https://community.dynatrace.com/u/krzysztof_hoja)\
**Post date:** [March 3, 2026, 10:04pm UTC](https://community.dynatrace.com/t/dql-recursive-array-to-column-extraction/55166/4 "2026-03-03T22:04:07Z")

</div>

1) It’s just my own invention&nbsp;:wink:

2) I would ask a different question here. I understood your question more as a visualization need. Our tables do not display well more complex arrays. I personally see data stored as array superior over this record/object I used to make this data more readable. It is just more convenient to process data when it is array. So why would you do this conversion such conversion in OpenPipeline? But I think that such transformation is already allowed in OP.

3) Right now not. I see a need for object-\>array and array-\>object functions. The first class could give you array of keys in object or array of key-value pairs. The second could construct an object from array of key-value pairs. Such array-\>object function would be useful for your need. Your array should be enchanted with key names and this is doable today with iterative expression.

---

<div class="post-metadata">

**Author:** ![Yann\_Buccellato](https://avatars.discourse-cdn.com/v4/letter/y/97f17d/32.png) [@Yann\_Buccellato](https://community.dynatrace.com/u/Yann_Buccellato)\
**Post date:** [March 4, 2026, 7:17am UTC](https://community.dynatrace.com/t/dql-recursive-array-to-column-extraction/55166/5 "2026-03-04T07:17:44Z")

</div>

1) you sure reached a deeper level of understanding on how the data structure behave. Hope I’ll reach that level too.

2) I share your view. For me the true reason behind making this change systematically in Openpipeline is easiness of read for non IT / non technical / not in Dynatrace / not in DQL people.  
I do agree the array, once/if well build, is superior and easier to have in one single field.

Thank you for all the support and feedback,

Yann

---

<div class="post-metadata">

**Author:** ![Yann\_Buccellato](https://avatars.discourse-cdn.com/v4/letter/y/97f17d/32.png) [@Yann\_Buccellato](https://community.dynatrace.com/u/Yann_Buccellato)\
**Post date:** [March 4, 2026, 11:13am UTC](https://community.dynatrace.com/t/dql-recursive-array-to-column-extraction/55166/6 "2026-03-04T11:13:56Z")

</div>

To my surprise arrayToString is not a function supported by open pipeline

---

<div class="post-metadata">

**Author:** ![krzysztof\_hoja](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/krzysztof_hoja/32/34625_2.png) [@krzysztof\_hoja](https://community.dynatrace.com/u/krzysztof_hoja)\
**Post date:** [March 4, 2026, 12:14pm UTC](https://community.dynatrace.com/t/dql-recursive-array-to-column-extraction/55166/7 "2026-03-04T12:14:17Z")

</div>

Surprise indeed. This is new function, so maybe it is temporary only.

Alternative not requiring _ **arrayToString** _

```markup
| fields bla = concat( iIndex(), ":", toString(bla[]))
| fields bla = replaceString(toString(bla),"\\\"","\"")
| parse bla,"""'[' KVP{ '"' LD:key ':' JSON:value ('", '|'"]') }:bla """
| fieldsFlatten bla
| fieldsRemove bla

```

---

<div class="post-metadata">

**Author:** ![Yann\_Buccellato](https://avatars.discourse-cdn.com/v4/letter/y/97f17d/32.png) [@Yann\_Buccellato](https://community.dynatrace.com/u/Yann_Buccellato)\
**Post date:** [March 4, 2026, 12:19pm UTC](https://community.dynatrace.com/t/dql-recursive-array-to-column-extraction/55166/8 "2026-03-04T12:19:24Z")

</div>

Most probably. After the conversation we had here I decided to follow what you said in your point 2).[seeing “data stored as array superior”]

I’ll keep the field as an array in OpenPipeline, so the original Bizevent will be tinner. Will later distribute in that many column for that many array elements in the down stream apps: Dashboard and Notebook (and some automated reported via excel).
