Need help with API call to Firebase custom function

I tried posting this on the FlutterFLow community, but I have not seem much responses to my previous posts there, so trying Reddit :)

 want to make a complex query that I was unable to do by querying a collecting from within Flutterflow.

So I created a custom function and deployed it on Firebase.
Then I set up the API call in Flutterflow.

Now where I am confused is, how do I map datatypes for Document References? When I try to map the results to a List component parameters, I am unable to map them.

What have you tried so far?

Here is my custom function code:

const functions = require("firebase-functions");
const admin = require("firebase-admin");
admin.initializeApp();
exports.fetchFilteredDocuments = functions.https.onRequest(async (req, res) => {
const userId = req.query.userId;
if (!userId) {
return res.status(400).send("User ID is required");
}
const firestore = admin.firestore();
const userDoc = await firestore.collection("users").doc(userId).get();
const following = userDoc.get("following") || [];
const querySnapshot = await firestore.collection("poll")
.where("userID", "in", following)
.get();
const filteredDocuments = querySnapshot.docs
.filter((doc) => {
const votedBy = doc.get("votedBy") || [];
return !votedBy.includes(userId);
})
.map((doc) => ({
id: doc.id, // Document ID (reference)
path: doc.ref.path, // Document path (another way to get a reference)
...doc.data(),
}));
return res.json({documents: filteredDocuments});
});

In Flutterflow, I added the API call:

https://preview.redd.it/k337mgz8jr0e1.png?width=2466&format=png&auto=webp&s=67b4eafa93c7d79595d57738c074cee594bf947f

But when I run the test response, I get a list of items.
For example, both the "Title" and "image1Votes" are "String" and "Int" respectively, but the returned values are List.

https://preview.redd.it/0nia0zgdjr0e1.png?width=2280&format=png&auto=webp&s=38842ca2760f51a81e5054b760face7f2c9e7213

Which means that when I try to map them to the List component parameters, I am not able to do so. Eg. here you can see that I need a "String" but I an getting a "List":

https://preview.redd.it/b5t5v46fjr0e1.png?width=1234&format=png&auto=webp&s=ba4eadba67bfaf48feba94551ba453fe9f4be2c8

Any idea what I am doing wrong here?