You’re going to need two things.
- Initialize an API call in Bubble API Connector that loads the JSON object you’re trying to return to your client (your matrix / list of lists).
- Create a custom Bubble plugin that returns that list of lists having set it’s return type to “App Type”
Tackling the first item is the easiest. Save your object which you’re already console.logging to a json file, upload that to your App (to get it available at a URL), and then initialize a Bubble API connector call to the URL of the json file you just uploaded. At this point you have an API call that knows the structure of the data you want to return.
The second aspect is a little trickier but is a solved problem in Bubble. In short, in the custom plugin you’re going to have made, you’ll have to massage your lists of lists to have the certain structure that Bubble expects “Bubble API call objects” to be in. Nice folks in the forum have previously created javascript to do this for you which you can find here. For discussion on the topic, see here.