# Issue in using Split in batches node to split JSON array

**URL:** <https://community.n8n.io/t/issue-in-using-split-in-batches-node-to-split-json-array/19212>\
**Category:** Questions\
**Tags:** item-lists\
**Created:** [October 31, 2022, 10:04am UTC](https://community.n8n.io/t/issue-in-using-split-in-batches-node-to-split-json-array/19212 "2022-10-31T10:04:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Meghna\_jose](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/meghna_jose/32/6378_2.png) [@Meghna\_jose](https://community.n8n.io/u/Meghna_jose)\
**Post date:** [October 31, 2022, 10:04am UTC](https://community.n8n.io/t/issue-in-using-split-in-batches-node-to-split-json-array/19212/1 "2022-10-31T10:04:31Z")

</div>

Hi,  
I have a workflow which fetches City details from QuestDB and since I require city name and geocode I have filtered them using function node. Also, I want to split the data (123 items in the array as 123 batches) obtained for further process. Since its a JSON array, after the split node entire data is in the output. Is there any way so I could split them?

## Share the output returned by the last node

## Information on your n8n setup

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

---

<div class="post-metadata">

**Author:** ![BramKn](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/bramkn/32/11894_2.png) [@BramKn](https://community.n8n.io/u/BramKn)\
**Post date:** [October 31, 2022, 10:13am UTC](https://community.n8n.io/t/issue-in-using-split-in-batches-node-to-split-json-array/19212/2 "2022-10-31T10:13:56Z")

</div>

Hi @Meghna_jose

Welcome back!  
I think you are looking for the item lists node.

---

<div class="post-metadata">

**Author:** ![Meghna\_jose](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/meghna_jose/32/6378_2.png) [@Meghna\_jose](https://community.n8n.io/u/Meghna_jose)\
**Post date:** [October 31, 2022, 10:30am UTC](https://community.n8n.io/t/issue-in-using-split-in-batches-node-to-split-json-array/19212/3 "2022-10-31T10:30:45Z")

</div>

Hi @BramKn ,  
Thanks for your response.  
I have tried that too, I got an error while executing it. The output from QuestDB is in this fashion:

> **Output**
>
> ````auto
> 
> {
> 
> "query":"select * from CityDetails;",
> 
> "columns":[
> 
> {
> 
> "name":"State",
> 
> "type":"STRING"
> 
> },
> 
> {
> 
> "name":"City",
> 
> "type":"STRING"
> 
> },
> 
> {
> 
> "name":"Geocode",
> 
> "type":"STRING"
> 
> },
> 
> {
> 
> "name":"Population",
> 
> "type":"INT"
> 
> }
> 
> ],
> 
> "dataset":[
> 
> [
> 
> "Georgia",
> 
> "Atlanta",
> 
> "34.0567006,-84.3436881",
> 
> 496461
> 
> ],
> 
> [
> 
> "Pennsylvania",
> 
> "Philadelphia",
> 
> "39.9840919,-75.1808035",
> 
> 1576251
> 
> ],
> 
> [
> 
> "Texas",
> 
> "Dallas",
> 
> "33.3740446,-95.69145",
> 
> 1288457
> 
> ],
> 
> [
> 
> "Illinois",
> 
> "Chicago",
> 
> "41.9790639,-88.1437782",
> 
> 2696555
> 
> ],
> 
> [
> 
> "District of Columbia",
> 
> "Washington",
> 
> "38.912068,-77.0190228",
> 
> 670050
> 
> ],
> 
> [
> 
> "Pennsylvania",
> 
> "Pittsburgh",
> 
> "40.7943923,-79.7512033",
> 
> 300431
> 
> ],
> 
> [
> 
> "New York",
> 
> "New York",
> 
> "40.8093249,-72.8456399",
> 
> 8467513
> 
> ],
> 
> [
> 
> "Minnesota",
> 
> "Minneapolis",
> 
> "44.9944872,-93.2983975",
> 
> 425336
> 
> ],
> 
> [
> 
> "Texas",
> 
> "Houston",
> 
> "29.9643725,-95.7510475",
> 
> 2288250
> 
> ],
> 
> [
> 
> "Indiana",
> 
> "Indianapolis",
> 
> "39.8638689,-86.3984793",
> 
> 891342
> 
> ],
> 
> [
> 
> "Florida",
> 
> "Orlando",
> 
> "29.0513017,-81.7568704",
> 
> 309154
> 
> ],
> 
> [
> 
> "North Carolina",
> 
> "Charlotte",
> 
> "35.2326781,-80.8460822",
> 
> 879709
> 
> ],
> 
> [
> 
> "Ohio",
> 
> "Cincinnati",
> 
> "39.2364358,-84.3647199",
> 
> 308935
> 
> ],
> 
> [
> 
> "Michigan",
> 
> "Detroit",
> 
> "42.4344566,-83.6561215",
> 
> 321793
> 
> ],
> 
> [
> 
> "Ohio",
> 
> "Cleveland",
> 
> "41.1567039,-81.6254283",
> 
> 15865
> 
> ],
> 
> [
> 
> "Louisiana",
> 
> "New Orleans",
> 
> "29.9392154,-90.1963364",
> 
> 60270
> 
> ],
> 
> [
> 
> "Missouri",
> 
> "St Louis",
> 
> "38.4530404,-90.3089777",
> 
> 37667
> 
> ],
> 
> [
> 
> "Tennessee",
> 
> "Memphis",
> 
> "35.5000984,-89.9813445",
> 
> 162
> 
> ],
> 
> [
> 
> "Missouri",
> 
> "Kansas City",
> 
> "39.0587452,-94.5985613",
> 
> 90457
> 
> ],
> 
> [
> 
> "Tennessee",
> 
> "Nashville",
> 
> "35.9665237,-86.2767995",
> 
> 116486
> 
> ],
> 
> [
> 
> "Connecticut",
> 
> "Hartford",
> 
> "41.6955511,-72.3074326",
> 
> 733919
> 
> ],
> 
> [
> 
> "Maryland",
> 
> "Baltimore",
> 
> "39.2963369,-76.6210539",
> 
> 2804
> 
> ],
> 
> [
> 
> "New Jersey",
> 
> "Morristown",
> 
> "40.7967667,-74.4815438",
> 
> 121465
> 
> ],
> 
> [
> 
> "North Carolina",
> 
> "Raleigh",
> 
> "35.7927515,-78.6540576",
> 
> 42772
> 
> ],
> 
> [
> 
> "Texas",
> 
> "Austin",
> 
> "30.432242,-97.7145152",
> 
> 147711
> 
> ],
> 
> [
> 
> "Texas",
> 
> "SAN ANTONIO",
> 
> "29.2300189,-97.9157099",
> 
> 94844
> 
> ],
> 
> [
> 
> "Alabama",
> 
> "Birmingham",
> 
> "33.52,-86.8",
> 
> 197102
> 
> ],
> 
> [
> 
> "Delaware",
> 
> "Wilmington",
> 
> "38.624844,-75.4944189",
> 
> 21945
> 
> ],
> 
> [
> 
> "Oklahoma",
> 
> "Oklahoma City",
> 
> "35.2620934,-97.5897372",
> 
> 39995
> 
> ],
> 
> [
> 
> "Ohio",
> 
> "Columbus",
> 
> "39.9556925,-82.9340217",
> 
> 112368
> 
> ],
> 
> [
> 
> "Mississippi",
> 
> "Jackson",
> 
> "32.2255867,-90.15418",
> 
> 51846
> 
> ],
> 
> [
> 
> "Colorado",
> 
> "Denver",
> 
> "39.7845048,-104.9797753",
> 
> 205918
> 
> ],
> 
> [
> 
> "North Carolina",
> 
> "Winston Salem",
> 
> "36.0998596,-80.244216",
> 
> 39958
> 
> ],
> 
> [
> 
> "Louisiana",
> 
> "Baton Rouge",
> 
> "30.6280171,-90.9533984",
> 
> 196528
> 
> ],
> 
> [
> 
> "New York",
> 
> "Buffalo",
> 
> "43.0519044,-78.6341996",
> 
> 543242
> 
> ],
> 
> [
> 
> "Pennsylvania",
> 
> "York",
> 
> "39.9625984,-76.727745",
> 
> 102988
> 
> ],
> 
> [
> 
> "Florida",
> 
> "Tampa",
> 
> "27.6862802,-82.2800546",
> 
> 34424
> 
> ],
> 
> [
> 
> "Iowa",
> 
> "Des Moines",
> 
> "41.5346558,-93.6116494",
> 
> 528
> 
> ],
> 
> [
> 
> "Michigan",
> 
> "middleville",
> 
> "42.7130889,-85.4619599",
> 
> 26430
> 
> ],
> 
> [
> 
> "Maryland",
> 
> "Waldorf",
> 
> "38.6705753,-77.0449327",
> 
> 632464
> 
> ],
> 
> [
> 
> "South Carolina",
> 
> "Greenville",
> 
> "34.8083898,-82.3343375",
> 
> 367991
> 
> ],
> 
> [
> 
> "Kentucky",
> 
> "Lexington",
> 
> "37.9828762,-84.5667665",
> 
> 376971
> 
> ],
> 
> [
> 
> "Indiana",
> 
> "warsaw",
> 
> "41.2381,-85.8530469",
> 
> 293310
> 
> ],
> 
> [
> 
> "Ohio",
> 
> "Youngstown",
> 
> "41.1742928,-80.6881718",
> 
> 628127
> 
> ],
> 
> [
> 
> "Mississippi",
> 
> "Tupelo",
> 
> "34.8984684,-88.5951751",
> 
> 508394
> 
> ],
> 
> [
> 
> "Georgia",
> 
> "Genova",
> 
> "32.4559867,-84.8776392",
> 
> 703953
> 
> ],
> 
> [
> 
> "New Jersey",
> 
> "Trenton",
> 
> "40.3379035,-74.5873348",
> 
> 120576
> 
> ],
> 
> [
> 
> "Indiana",
> 
> "Evansville",
> 
> "38.1993507,-87.7074089",
> 
> 576498
> 
> ],
> 
> [
> 
> "Washington",
> 
> "Seattle",
> 
> "47.6264794,-122.2051487",
> 
> 20276
> 
> ],
> 
> [
> 
> "Minnesota",
> 
> "Albany",
> 
> "45.6299647,-94.5700048",
> 
> 469124
> 
> ],
> 
> [
> 
> "Minnesota",
> 
> "Rochester",
> 
> "43.8595945,-92.4801989",
> 
> 964177
> 
> ],
> 
> [
> 
> "Missouri",
> 
> "Jefferson City",
> 
> "38.8461702,-91.949021",
> 
> 1451853
> 
> ],
> 
> [
> 
> "Illinois",
> 
> "Rockford",
> 
> "42.2133849,-89.1515476",
> 
> 107015
> 
> ],
> 
> [
> 
> "Pennsylvania",
> 
> "Reading",
> 
> "40.3380072,-75.9753516",
> 
> 117643
> 
> ],
> 
> [
> 
> "Wisconsin",
> 
> "Green Bay",
> 
> "44.5133188,-88.0132958",
> 
> 641162
> 
> ],
> 
> [
> 
> "North Carolina",
> 
> "Wilmington",
> 
> "34.2103894,-77.8868117",
> 
> 71175
> 
> ],
> 
> [
> 
> "Oregon",
> 
> "Portland",
> 
> "45.484172,-122.384875",
> 
> 292657
> 
> ],
> 
> [
> 
> "Alabama",
> 
> "Dothan",
> 
> "31.25,-85.41",
> 
> 260993
> 
> ],
> 
> [
> 
> "Nebraska",
> 
> "Lincoln",
> 
> "40.8247318,-96.6157192",
> 
> 646790
> 
> ],
> 
> [
> 
> "Texas",
> 
> "Lubbock",
> 
> "33.6330357,-101.5475409",
> 
> 44787
> 
> ],
> 
> [
> 
> "Nevada",
> 
> "Las Vegas",
> 
> "36.128561,-115.1711298",
> 
> 68114
> 
> ],
> 
> [
> 
> "Louisiana",
> 
> "Alexandria",
> 
> "31.38269,-92.1057549",
> 
> 45672
> 
> ],
> 
> [
> 
> "Tennessee",
> 
> "Jackson",
> 
> "35.98423,-88.6819958",
> 
> 117445
> 
> ],
> 
> [
> 
> "Virginia",
> 
> "Charlottesville",
> 
> "38.7134739,-78.1593766",
> 
> 268508
> 
> ],
> 
> [
> 
> "Montana",
> 
> "Billings",
> 
> "45.8781756,-108.4680798",
> 
> 288121
> 
> ],
> 
> [
> 
> "Ohio",
> 
> "Toledo",
> 
> "41.4575193,-83.6086855",
> 
> 15851
> 
> ],
> 
> [
> 
> "Alaska",
> 
> "anchorage",
> 
> "61.22,-149.9",
> 
> 26278
> 
> ],
> 
> [
> 
> "Arkansas",
> 
> "Charleston",
> 
> "35.2971909,-94.0437396",
> 
> 182
> 
> ],
> 
> [
> 
> "Texas",
> 
> "Beaumont",
> 
> "30.2529772,-94.2128337",
> 
> 9582
> 
> ],
> 
> [
> 
> "Missouri",
> 
> "oregon",
> 
> "39.9869407,-95.1449753",
> 
> 58525
> 
> ],
> 
> [
> 
> "New York",
> 
> "Staten Island",
> 
> "40.5729336,-74.1298684",
> 
> 18294
> 
> ],
> 
> [
> 
> "Illinois",
> 
> "Southern Illinois",
> 
> "37.9947221,-88.9222277",
> 
> 229071
> 
> ],
> 
> [
> 
> "Oklahoma",
> 
> "Lawton",
> 
> "34.5618456,-98.2431747",
> 
> 85617
> 
> ],
> 
> [
> 
> "Ohio",
> 
> "Stubenville",
> 
> "40.3697905,-80.6339638",
> 
> 53213
> 
> ],
> 
> [
> 
> "New York",
> 
> "Bronx",
> 
> "40.6900246,-73.8213213",
> 
> 52335
> 
> ],
> 
> [
> 
> "Kansas",
> 
> "wilson",
> 
> "38.8250106,-98.4753437",
> 
> 139594
> 
> ],
> 
> [
> 
> "Wyoming",
> 
> "Cheyenne",
> 
> "41.1399814,-104.8202462",
> 
> 34045
> 
> ],
> 
> [
> 
> "New Hampshire",
> 
> "Dover",
> 
> "43.3071121,-71.691066",
> 
> 140398
> 
> ],
> 
> [
> 
> "Louisiana",
> 
> "West Monroe",
> 
> "32.5184775,-92.1476353",
> 
> 197575
> 
> ],
> 
> [
> 
> "North Carolina",
> 
> "Fayetteville",
> 
> "34.9788116,-78.8948741",
> 
> 70750
> 
> ],
> 
> [
> 
> "Idaho",
> 
> "Boise",
> 
> "43.5896264,-116.6132313",
> 
> 687725
> 
> ],
> 
> [
> 
> "Minnesota",
> 
> "St Paul",
> 
> "44.9748419,-93.1811141",
> 
> 906528
> 
> ],
> 
> [
> 
> "Florida",
> 
> "Tallahassee",
> 
> "30.3094319,-84.7942091",
> 
> 149761
> 
> ],
> 
> [
> 
> "Maine",
> 
> "Brunswick",
> 
> "43.9140162,-69.9669961",
> 
> 711463
> 
> ],
> 
> [
> 
> "Massachusetts",
> 
> "Amherst",
> 
> "42.4559124,-72.9342451",
> 
> 250320
> 
> ],
> 
> [
> 
> "Colorado",
> 
> "Pueblo",
> 
> "38.2292616,-104.4956239",
> 
> 222185
> 
> ],
> 
> [
> 
> "Missouri",
> 
> "Joplin",
> 
> "37.1034245,-94.5418141",
> 
> 276807
> 
> ],
> 
> [
> 
> "Massachusetts",
> 
> "Worcester",
> 
> "42.2971508,-71.8393443",
> 
> 44834
> 
> ],
> 
> [
> 
> "South Carolina",
> 
> "Florence",
> 
> "34.1954331,-79.7625625",
> 
> 387050
> 
> ],
> 
> [
> 
> "South Dakota",
> 
> "Sioux Falls",
> 
> "43.521619,-96.722641",
> 
> 212031
> 
> ],
> 
> [
> 
> "Arizona",
> 
> "Tucson",
> 
> "32.2540946,-110.8850949",
> 
> 4341
> 
> ],
> 
> [
> 
> "Texas",
> 
> "Wichita Falls",
> 
> "33.9346093,-98.539144",
> 
> 77881
> 
> ],
> 
> [
> 
> "Mississippi",
> 
> "Meridian",
> 
> "32.3643098,-88.703656",
> 
> 72095
> 
> ],
> 
> [
> 
> "Missouri",
> 
> "Lodge",
> 
> "37.3244579,-90.1281233",
> 
> 2623
> 
> ],
> 
> [
> 
> "Mississippi",
> 
> "Oxford",
> 
> "34.3668299,-89.518635",
> 
> 112556
> 
> ],
> 
> [
> 
> "Vermont",
> 
> "Rutland",
> 
> "43.1772133,-72.8160976",
> 
> 827
> 
> ],
> 
> [
> 
> "Kentucky",
> 
> "Paducah",
> 
> "37.0100528,-88.5758574",
> 
> 474893
> 
> ],
> 
> [
> 
> "Kansas",
> 
> "Lebanon",
> 
> "39.8097343,-98.5556199",
> 
> 125812
> 
> ],
> 
> [
> 
> "Illinois",
> 
> "LaSalle",
> 
> "41.375388,-88.8455037",
> 
> 91055
> 
> ],
> 
> [
> 
> "Indiana",
> 
> "Terra Haute",
> 
> "39.4511918,-87.5890092",
> 
> 17962
> 
> ],
> 
> [
> 
> "Florida",
> 
> "Panama City Beach",
> 
> "30.2097667,-85.8556808",
> 
> 6525
> 
> ],
> 
> [
> 
> "Washington",
> 
> "Spokane",
> 
> "47.3436089,-117.2292718",
> 
> 836
> 
> ],
> 
> [
> 
> "Iowa",
> 
> "Sioux City",
> 
> "42.4644043,-96.333242",
> 
> 65051
> 
> ],
> 
> [
> 
> "Idaho",
> 
> "Twin Falls",
> 
> "42.3986045,-114.5613507",
> 
> 33171
> 
> ],
> 
> [
> 
> "Nebraska",
> 
> "Grand Island",
> 
> "40.9628474,-98.2869478",
> 
> 12856
> 
> ],
> 
> [
> 
> "Texas",
> 
> "Waco",
> 
> "31.2776209,-97.2113605",
> 
> 208778
> 
> ],
> 
> [
> 
> "Florida",
> 
> "Panama City",
> 
> "30.1588129,-85.6602058",
> 
> 237446
> 
> ],
> 
> [
> 
> "Florida",
> 
> "Gainesville",
> 
> "29.6167806,-82.7994194",
> 
> 307193
> 
> ],
> 
> [
> 
> "Nebraska",
> 
> "Alliance",
> 
> "42.0930235,-102.8702006",
> 
> 7971
> 
> ],
> 
> [
> 
> "North Dakota",
> 
> "Bismark",
> 
> "46.8243438,-100.659753",
> 
> 74138
> 
> ],
> 
> [
> 
> "California",
> 
> "San Diego",
> 
> "32.6920499,-117.1911749",
> 
> 1381611
> 
> ],
> 
> [
> 
> "Texas",
> 
> "Encino",
> 
> "26.9361628,-98.1352829",
> 
> 539
> 
> ],
> 
> [
> 
> "Montana",
> 
> "Whitlash",
> 
> "48.9083386,-111.2530312",
> 
> 18
> 
> ],
> 
> [
> 
> "Oregon",
> 
> "Eugene",
> 
> "44.0637173,-123.0847061",
> 
> 175096
> 
> ],
> 
> [
> 
> "Oklahoma",
> 
> "Enid",
> 
> "36.4189191,-97.8068851",
> 
> 50566
> 
> ],
> 
> [
> 
> "West Virginia",
> 
> "Morgantown",
> 
> "39.629526,-79.9558968",
> 
> 29219
> 
> ],
> 
> [
> 
> "Alaska",
> 
> "Harrison",
> 
> "36.2297712,-93.107405",
> 
> 13225
> 
> ],
> 
> [
> 
> "Georgia",
> 
> "Tallahassee",
> 
> "30.4305062,-84.2542195",
> 
> 32
> 
> ],
> 
> [
> 
> "Michigan",
> 
> "Marinette",
> 
> "45.4888208,-87.9963408",
> 
> 10968
> 
> ],
> 
> [
> 
> "Pennsylvania",
> 
> "Susquehannock",
> 
> "41.513262,-77.6765184",
> 
> 1365
> 
> ],
> 
> [
> 
> "West Virginia",
> 
> "Beckley",
> 
> "37.7324747,-81.2463763",
> 
> 17024
> 
> ],
> 
> [
> 
> "Tennessee",
> 
> "Southwest",
> 
> "35.3255332,-87.7369607",
> 
> 9511
> 
> ],
> 
> [
> 
> "Georgia",
> 
> "Rome",
> 
> "34.257038,-85.1646726",
> 
> 37746
> 
> ]
> 
> ],
> 
> "count":123
> 
> }
> 
> ]```
> 
> ````

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [October 31, 2022, 12:03pm UTC](https://community.n8n.io/t/issue-in-using-split-in-batches-node-to-split-json-array/19212/4 "2022-10-31T12:03:33Z")

</div>

Hey @Meghna_jose,

It looks like an Item Lists node would do what you are after, If you add it after your Set node and set the “Field to split out” to `Input` you will get something like the below.

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/7/2/72e6cc51699d132ab8d3d44fd662239d6c0750b3.png)

---

<div class="post-metadata">

**Author:** ![Meghna\_jose](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/meghna_jose/32/6378_2.png) [@Meghna\_jose](https://community.n8n.io/u/Meghna_jose)\
**Post date:** [October 31, 2022, 12:38pm UTC](https://community.n8n.io/t/issue-in-using-split-in-batches-node-to-split-json-array/19212/5 "2022-10-31T12:38:47Z")

</div>

Hi @Jon ,  
Thanks a lot. It works and I can complete the rest of the workflow.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [November 7, 2022, 12:39pm UTC](https://community.n8n.io/t/issue-in-using-split-in-batches-node-to-split-json-array/19212/6 "2022-11-07T12:39:04Z")

</div>

Closed on November 7, 2022, 12:39pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
