Page 1 of 1

Nested JSON Arrays and Objects

Posted: Thu Dec 31, 2020 3:00 pm
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 2900 times

Re: Nested JSON Arrays and Objects

Posted: Mon Jan 04, 2021 8:34 pm
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.


Re: Nested JSON Arrays and Objects

Posted: Tue Jan 12, 2021 4:03 pm
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?


Re: Nested JSON Arrays and Objects

Posted: Wed Jan 13, 2021 4:07 am
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.


Re: Nested JSON Arrays and Objects

Posted: Sat Jan 16, 2021 2:47 pm
by Galyna Abramovych

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