# Array/Collection into plain text

**URL:** <https://community.make.com/t/array-collection-into-plain-text/14234>\
**Category:** Questions\
**Tags:** collections, arrays\
**Created:** [August 10, 2023, 8:27am UTC](https://community.make.com/t/array-collection-into-plain-text/14234 "2023-08-10T08:27:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![leotulipan](https://avatars.discourse-cdn.com/v4/letter/l/e47c2d/32.png) [@leotulipan](https://community.make.com/u/leotulipan)\
**Post date:** [August 10, 2023, 8:27am UTC](https://community.make.com/t/array-collection-into-plain-text/14234/1 "2023-08-10T08:27:54Z")

</div>

After an array aggregation in my scenario I have collection ? (array?) like this which I need in one simple text to pass on to OpenAI

Which simple function can I use? Just a simple long text string “From: User, concent: c, timestamp, …” how can I achive this. I tried flatten() even two times but it doesnt work. Documentation is also spotty on these transformations

[  
{  
“array”: [  
{  
“from”: “user”,  
“content”:c",  
“timestamp”: “2023-08-08T13:31:10.844Z”  
},  
{  
“from”: “operator”,  
“content”: “c”,  
“timestamp”: “2023-08-08T13:36:59.366Z”  
},  
{  
“from”: “operator”,  
“content”: “c”,  
“timestamp”: “2023-08-09T09:55:32.154Z”  
},  
{  
“from”: “operator”,  
“content”: {  
“namespace”: “state:resolved”  
},  
“timestamp”: “2023-08-09T09:55:34.756Z”  
},  
{  
“from”: “user”,  
“content”: “c”,  
“timestamp”: “2023-08-10T07:21:54.891Z”  
}  
],  
“ **IMTAGGLENGTH** ”: 5  
}  
]

I only want to call OpenAI once with all messages concatenated…

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/2X/c/cf6c403fe11e8d867c0006c11ac2be9bb096e69b.png)

---

<div class="post-metadata">

**Author:** ![Msquare\_Automation](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/msquare_automation/32/6634_2.png) [@Msquare\_Automation](https://community.make.com/u/Msquare_Automation)\
**Post date:** [August 10, 2023, 11:21am UTC](https://community.make.com/t/array-collection-into-plain-text/14234/2 "2023-08-10T11:21:21Z")

</div>

Hi @leotulipan

I think you need to aggregate the parameter into text. So please use Text aggregator with suitable separation(, or space) accordingly with your requirements.

![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/2X/5/5469011f9577382a836610bed7b941e458a5d26a.png)

This will result text data

[MSquare Support](https://calendly.com/msquarepro/meeting)  
Visit us [here](https://www.msquare.pro/)  
[Youtube Channel](https://www.youtube.com/channel/UCqidlIIwbejxZmRUWBICcjQ)

---

<div class="post-metadata">

**Author:** ![leotulipan](https://avatars.discourse-cdn.com/v4/letter/l/e47c2d/32.png) [@leotulipan](https://community.make.com/u/leotulipan)\
**Post date:** [August 10, 2023, 3:17pm UTC](https://community.make.com/t/array-collection-into-plain-text/14234/3 "2023-08-10T15:17:09Z")

</div>

But how do you use this in what order. It is not clear to me. Sometimes I feel I’d rather make python code than to find out how these modules work

Doing this

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/2X/d/d73ccd937db83a19b9d1e45ab23a1248313197b7.png)

yields:

“value”: “[Collection], [Collection]” as input and therefore as output as well. See the structure that comes out of the array module above…

Again, I fell I need to flatten or convert this multi-dimensional array, but I do not know how. This should be a built in function? Even outputting the above JSON like structure would be fine

---

<div class="post-metadata">

**Author:** ![Fasil](https://avatars.discourse-cdn.com/v4/letter/f/b38774/32.png) [@Fasil](https://community.make.com/u/Fasil)\
**Post date:** [August 10, 2023, 3:54pm UTC](https://community.make.com/t/array-collection-into-plain-text/14234/4 "2023-08-10T15:54:08Z")

</div>

Hi

Simply use an iterator after your array aggregator and map the aggregator’s output to the iterator. Then you will get the operator, content and time stamp as mappable variables.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/2X/b/b1dd54aa0fee450d4e0e227009e7147033941183.png)

[MSquare Support](https://calendly.com/msquarepro/meeting)  
Visit us [here](https://www.msquare.pro/)  
[Youtube Channel](https://www.youtube.com/channel/UCqidlIIwbejxZmRUWBICcjQ)

---

<div class="post-metadata">

**Author:** ![leotulipan](https://avatars.discourse-cdn.com/v4/letter/l/e47c2d/32.png) [@leotulipan](https://community.make.com/u/leotulipan)\
**Post date:** [August 11, 2023, 5:58am UTC](https://community.make.com/t/array-collection-into-plain-text/14234/5 "2023-08-11T05:58:46Z")

</div>

I do not want separate bundles. I WANT ONE TEXT

- Get message results
- aggregate multiple messages into one element  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/2X/b/b4a0910d7b7732da32de180c869e56a5a1850d86.png)
- MISSING: Get this output in some form of PLAIN TEXT to send over to OpenAI e.g. in the simple form “From: user On: Timestmap Content: 1; From …”

Using another iterator after the aggregator just splits up the elements again and would call OpenAI for each Bundle (in this case two times).

Ideally Make would be intelligent enough when I put the array element in the Message Content to turn this into plain text and not “[collection], [collection]”

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/2X/b/b1ef49a8b6adfcbc5bc60a098a38e066f81d2f8a.png)

**BUT: A transform to JSON did the trick:** That way I got ONE text output and this I can paste into OpenAI

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/2X/f/f75ff6b64c42aca4acf539d4b04be0c306550746.png)

---

<div class="post-metadata">

**Author:** ![FAQs](https://avatars.discourse-cdn.com/v4/letter/f/eb8c5e/32.png) [@FAQs](https://community.make.com/u/FAQs)\
**Post date:** [August 25, 2023, 11:00pm UTC](https://community.make.com/t/array-collection-into-plain-text/14234/6 "2023-08-25T23:00:01Z")

</div>


