Hi. After having already read:
and
, I am still stuck on the following issue:
I am trying to pull an array from my database (in the collection Members, the array is under the name of “interactions”) and use that array to populate a repeater. I do not understand where the error message comes from. I think the issue could be relating to the types of data? I am not too sure why the console displays [object Object] and not the array in detail. At this point I am at loss because it seems like everything I tried does not work.
function setSidePanel(dataset, userId, j) {
wixData.query("Members")
.eq("_id", userId)
.find()
.then(async (results) => {
console.log("results.items[0].interactions.length: " + results.items[0].interactions.length)
console.log("typeof results.items[0].interactions: " + typeof results.items[0].interactions)
let currentUser = [];
for (let i = 0; i < 5; i++) {
let x = results.items[0].interactions[0];
console.log("x: " + x)
let y = [x];
console.log("y: " + y)
currentUser = currentUser.concat(y);
console.log("currentUser: " + currentUser)
}
console.log("currentUser: " + currentUser)
$w("#repeaterInUser").onItemReady(async ($w, itemData, index) => {
$w("#profilePic").src = (await getProfile(itemData, 1, j, dataset));
$w("#name").text = (await getProfile(itemData, 0, j, dataset));
});
// console.log("currentUser.interactions: "+ currentUser.interactions)
$w("#repeaterInUser").data = currentUser;
});
}