Nested JSON Arrays and Objects

Moderator: Support

tbednarzyk
Posts: 9
Joined: Thu Dec 31, 2020 1:42 pm

Nested JSON Arrays and Objects

Post by tbednarzyk »

I'm attempting to build an app using the TicketMaster Discovery API (https://developer.ticketmaster.com/prod ... /#overview) to display EVENT information. However, upon trying to complete the mappings in the App Builder, I can't get the venue and event details to render. I think, based on my research, that it's because the EVENT DETAILS are an array within the EVENTS array. I've tried doing various mappings within the App Builder to get the data to render but all I can get is the EVENT name and the EVENT time. I can not get the EVENT location, city, state, etc. information that appears to be nested in the venue array.

Do I need to do some sort of Javascript to resolve this? If someone can point me to a relevant example, I think I'll be able to figure it out but I'm a novice developer and what seems like a simple thing is a bit over my head right now.

Appreciate the help!

App Builder Mapping of TicketMaster Discovery API
App Builder Mapping of TicketMaster Discovery API
Screen Shot 2020-12-31 at 9.57.53 AM.png (199.63 KiB) Viewed 1238 times
Serhii Kulibaba
Posts: 147
Joined: Tue Aug 27, 2013 1:47 pm

Re: Nested JSON Arrays and Objects

Post by Serhii Kulibaba »

Hello,

Please generate the correct service response structure on the test service page. Just run the same request there as you do in the application and click on the button "Import as Response". After that, you will get exactly the same data structure for the mapping as the response has.

tbednarzyk
Posts: 9
Joined: Thu Dec 31, 2020 1:42 pm

Re: Nested JSON Arrays and Objects

Post by tbednarzyk »

I'm not sure what you mean by "generate the correct service response structure on the test service page." I believe I've done that which is how I ended up with the structure on the left of my screenshot. When I search records, I get the Event Name to return but the CIty, State, etc. return empty because they're arrays/objects within the parent array. So, should I be doing something like the attached where I map both Objects to the List Object?

Attachments
Screen Shot 2021-01-12 at 10.58.10 AM.png
Screen Shot 2021-01-12 at 10.58.10 AM.png (164.98 KiB) Viewed 1202 times
tbednarzyk
Posts: 9
Joined: Thu Dec 31, 2020 1:42 pm

Re: Nested JSON Arrays and Objects

Post by tbednarzyk »

Well, that was quite painful for something that I thought would be a simple thing but I ultimately figured out the fix. It required me to map the nested object to the ListItemName instead of the List. Image attached.

Attachments
Screen Shot 2021-01-12 at 11.05.30 PM.png
Screen Shot 2021-01-12 at 11.05.30 PM.png (149.83 KiB) Viewed 1208 times
Galyna Abramovych
Site Admin
Posts: 69
Joined: Tue Mar 22, 2016 6:03 pm

Re: Nested JSON Arrays and Objects

Post by Galyna Abramovych »

Thank you for sharing your way!
We appreciate it very much!

Post Reply