Using a Javascript query to Create an array of objects from another query's results

I am trying to create a calendar to show events for different communities within our platform. We are storing events in firebase in a certain format so that our app can display these events. Bringing in the list of events from firebase is done through a getDocuments query and there's no issue displaying these events in a list format; however we think it would be more intuitive to display them using the calendar element in retool. However the array from the query doesn't show any events on the calendar; I'm assuming that is because the objects in the array need to match the schema of the example events you see when inserting the calendar into the app:
image
To fix this, I figured I'd write a JS query to trigger when getting the events that will return an array of event objects in this format:
image
I figured this would return an array of objects with the fields needed to create visual events on the calendar; however after running this query I don't see any data output in the preview and trying to access the data property of the query in the events section of the calendar's settings just shows that the rawData and data properties are null, why isn't any data returning from the function?
image

Hey @Brycejacobrichards!

Happy to help here! If I am following your use case here correctly it looks like you may just need to return list rather than console.logging it. Does the log in your console seem to return the correct values here?

Apologies, I had been playing around with it and taken the return statement out, however placing it back in does not seem to effect the result after saving and running
image

image

Whoops, just solved my own problem and feel pretty dumb.
return statement was in the wrong area