# Getting array inside array

**URL:** <https://community.n8n.io/t/getting-array-inside-array/18421>\
**Category:** Questions\
**Tags:** core, data-transformation\
**Created:** [October 6, 2022, 1:34pm UTC](https://community.n8n.io/t/getting-array-inside-array/18421 "2022-10-06T13:34:41Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlejandroAkbal](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/alejandroakbal/32/17822_2.png) [@AlejandroAkbal](https://community.n8n.io/u/AlejandroAkbal)\
**Post date:** [October 6, 2022, 1:34pm UTC](https://community.n8n.io/t/getting-array-inside-array/18421/1 "2022-10-06T13:34:41Z")

</div>

## Describe the issue/error/question

I’m trying to extract an array from an array so I can use those values in the following nodes

I get this:

```json
[  
  [
  1517411543616561200,
  1355908649537908700,
  1542435042907103200,
  1577555858002681900,
  1577558825946779600,
  1412005886202110000,
  1405217453999800300,
  1462159484088946700,
  1481317578442223600,
  1521925225650307000,
  1577563439253389300
  ]
] 

```

But I want this:

```json
[  
  1517411543616561200,
  1355908649537908700,
  1542435042907103200,
  1577555858002681900,
  1577558825946779600,
  1412005886202110000,
  1405217453999800300,
  1462159484088946700,
  1481317578442223600,
  1521925225650307000,
  1577563439253389300
] 

```

## What is the error message (if any)?

`ERROR: The provided field '[0]' is not an array`

## Please share the workflow

## Share the output returned by the last node

Expected output:

```json
[  
  1517411543616561200,
  1355908649537908700,
  1542435042907103200,
  1577555858002681900,
  1577558825946779600,
  1412005886202110000,
  1405217453999800300,
  1462159484088946700,
  1481317578442223600,
  1521925225650307000,
  1577563439253389300
] 

```

## Information on your n8n setup

- **n8n version:** 0.195.5
- **Database you’re using (default: SQLite):** SQLite
- **Running n8n with the execution process [own(default), main]:** own
- **Running n8n via [Docker, npm, n8n.cloud, desktop app]:** docker

---

<div class="post-metadata">

**Author:** ![MutedJam](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mutedjam/32/70851_2.png) [@MutedJam](https://community.n8n.io/u/MutedJam)\
**Post date:** [October 6, 2022, 1:41pm UTC](https://community.n8n.io/t/getting-array-inside-array/18421/2 "2022-10-06T13:41:37Z")

</div>

Hi @AlejandroAkbal, welcome to the community!

n8n doesn’t really support an array of integers. Instead, it would work internally with an array of objects [described here](https://docs.n8n.io/data/data-structure/).

What you could, however, do is something like this:

Here you’d have a proper list of n8n items with one property each after your first Item Lists node and could then perform additional operations:

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/6/7/67d212b502ad61fa7ea0cf124e9eaf52451f036c.png)

Would this work for you?

---

<div class="post-metadata">

**Author:** ![AlejandroAkbal](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/alejandroakbal/32/17822_2.png) [@AlejandroAkbal](https://community.n8n.io/u/AlejandroAkbal)\
**Post date:** [October 6, 2022, 1:45pm UTC](https://community.n8n.io/t/getting-array-inside-array/18421/3 "2022-10-06T13:45:43Z")

</div>

> [@AlejandroAkbal](#):
>
> ```auto
> [  
> [
> 1517411543616561200,
> 1355908649537908700,
> 1542435042907103200,
> 1577555858002681900,
> 1577558825946779600,
> 1412005886202110000,
> 1405217453999800300,
> 1462159484088946700,
> 1481317578442223600,
> 1521925225650307000,
> 1577563439253389300
> ]
> ] 
> 
> ```

Unfortunately, as you can see, when using the HTTP node with the output set to anything other than file, the data is corrupted. Look at the integers, they become something else, dont know why!

---

<div class="post-metadata">

**Author:** ![AlejandroAkbal](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/alejandroakbal/32/17822_2.png) [@AlejandroAkbal](https://community.n8n.io/u/AlejandroAkbal)\
**Post date:** [October 6, 2022, 1:47pm UTC](https://community.n8n.io/t/getting-array-inside-array/18421/4 "2022-10-06T13:47:41Z")

</div>

The real response is this:

```json
[
  1517411543616561152, 1355908649537908740, 1542435042907103232, 1577555858002681858, 1577558825946779648,
  1412005886202109953,
  1405217453999800322, 1462159484088946689, 1481317578442223629, 1521925225650307072, 1577563439253389316
]

```

But they are transformed to something else:

```json
[  
  [
  1517411543616561200,
  1355908649537908700,
  1542435042907103200,
  1577555858002681900,
  1577558825946779600,
  1412005886202110000,
  1405217453999800300,
  1462159484088946700,
  1481317578442223600,
  1521925225650307000,
  1577563439253389300
  ]
] 

```

---

<div class="post-metadata">

**Author:** ![MutedJam](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mutedjam/32/70851_2.png) [@MutedJam](https://community.n8n.io/u/MutedJam)\
**Post date:** [October 6, 2022, 1:57pm UTC](https://community.n8n.io/t/getting-array-inside-array/18421/5 "2022-10-06T13:57:33Z")

</div>

Ah sorry, this will be because the numbers aren’t suitable integers in JS. If storing this file as an array of strings isn’t an option for you, I think you will need a little custom function to deal with them.

This should do the job:

Result:

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/6/6/66f561c8006f882a0fe9d7eb7279c70bbd7728f8.png)

---

<div class="post-metadata">

**Author:** ![AlejandroAkbal](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/alejandroakbal/32/17822_2.png) [@AlejandroAkbal](https://community.n8n.io/u/AlejandroAkbal)\
**Post date:** [October 6, 2022, 2:01pm UTC](https://community.n8n.io/t/getting-array-inside-array/18421/6 "2022-10-06T14:01:17Z")

</div>

Huh, so it’s a problem in the JavaScript engine? It is not working correctly with those numbers?

---

<div class="post-metadata">

**Author:** ![MutedJam](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mutedjam/32/70851_2.png) [@MutedJam](https://community.n8n.io/u/MutedJam)\
**Post date:** [October 6, 2022, 2:06pm UTC](https://community.n8n.io/t/getting-array-inside-array/18421/7 "2022-10-06T14:06:13Z")

</div>

Yes, the largest safe integer in JS would be `9007199254740991` (16 digits, [see here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER#return_value_of_max_safe_integer)).

Values such as `1517411543616561152` have 19 digits, so they should be represented using a different data type. My recent example should deal with this.

---

<div class="post-metadata">

**Author:** ![AlejandroAkbal](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/alejandroakbal/32/17822_2.png) [@AlejandroAkbal](https://community.n8n.io/u/AlejandroAkbal)\
**Post date:** [October 6, 2022, 2:07pm UTC](https://community.n8n.io/t/getting-array-inside-array/18421/8 "2022-10-06T14:07:46Z")

</div>

Awesome, thanks for letting me know about this weird issue, just wrapped the data as strings to make things easier

Love your support @MutedJam \<3

---

<div class="post-metadata">

**Author:** ![MutedJam](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mutedjam/32/70851_2.png) [@MutedJam](https://community.n8n.io/u/MutedJam)\
**Post date:** [October 6, 2022, 2:08pm UTC](https://community.n8n.io/t/getting-array-inside-array/18421/9 "2022-10-06T14:08:39Z")

</div>

You’re most welcome and sorry for the initial confusion. It doesn’t happen very often this limit is exceeded so I didn’t even think about it until you pointed this out 🙈
