- Goal:
Hi, I have a nested listview. The first listview shows a list of music tracks and the second listview, show the relatedTracks. I have 2 queries. The first one to getAllTracks. This is the source of the first listview, and the second one to get related Tracks . Specifically this query is:
SELECT * FROM RelatedTracks WHERE RelatedTrackId = TrackId[i]
As you can see I would like to select all tracks that have in the column RelatedTrackId the Id of the track of the first listview. This means that, each Item of the first listView as a unique id that I need to pass to the query.
- Steps:
I tried several ways to do this, but none of them worked.
I tried to use transformer to combined 2 queries and get a JSON and use that JSON as a source for list view, but I don't understand how transformer works and it gave me no output.
So I tried storing the id of the track of the firstList view in a variable "trackId" and then use this variable as iterator (example: getRelatedTracks.data.id[trackId] but in this way all relatedTracks have the same data because trackId have only one value.
Last thing I tried is to use additionalScope. So, I created a JS Query that trigger getRelatedTracks and pass to it the id of the main track, but seems that the additionalScope is null.
What I would like to achieve is something like this
Track 1
- related track 1
- related track 2
- related track 3
Track 2 - related track 1
- related track 2
- related track 3
I don't know how to change the value of additional scope automatically, without triggering the JS Query manually. I would like that for each track, the additional scope changes with the iterator. So when the "i" values of the listTrack changes, also change the additionalScope.
Hope I was clear. I'm not a developer so I think I made some errors.
Can you help me? thank you
-
Details:
-
Screenshots:
-
App json export: (here's how to get a json export)