# Presenting data from several JSON files

**URL:** <https://forums.kodeco.com/t/presenting-data-from-several-json-files/9788>\
**Category:** tvOS\
**Created:** [March 15, 2016, 7:27pm UTC](https://forums.kodeco.com/t/presenting-data-from-several-json-files/9788 "2016-03-15T19:27:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![moggeandersson](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/moggeandersson/32/9872_2.png) [@moggeandersson](https://forums.kodeco.com/u/moggeandersson)\
**Post date:** [March 15, 2016, 7:27pm UTC](https://forums.kodeco.com/t/presenting-data-from-several-json-files/9788/1 "2016-03-15T19:27:46Z")

</div>

Hi!

Does anyone know a good way to join several json files so that I can present all that data in the same TVML template?

I’m using the code from “tvOS apprentice”, the fifth chapter and have successfully presented data from JSON objects coming from a server rather than locally.

Problem is that when I try to put json-objects in an array, so that I later can join them to one object it doesnt work.

I get this print when printing the whole array (a good print):

[Log] Hello TVML! (main.js, line 34)  
[Log] Array (1) (Populator.js, line 10)  
0{items: Array, totalExpectedItems: 0, hasMorePages: true}  
Array Prototype

But this print when trying to print the first object, array[0]:

[Log] Hello TVML! (main.js, line 34)  
[Log] undefined (Populator.js, line 10)

The whole HTTPrequest code I did is using Callbacks and stuff, maybe it has something to do with that?

---

<div class="post-metadata">

**Author:** ![marciokoko](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/marciokoko/32/32922_2.png) [@marciokoko](https://forums.kodeco.com/u/marciokoko)\
**Post date:** [March 18, 2016, 7:56pm UTC](https://forums.kodeco.com/t/presenting-data-from-several-json-files/9788/2 "2016-03-18T19:56:22Z")

</div>

I dont have any experience joining json files but it seems logical (although a step more) that you could parse the json files into a single database structure or even foundation object such as array or dict and simply work off that structure. If you wanted to join them into a new JSON file you could just serialize the foundation object into a json file as well.
