I create a table with code. But unfortunately I cannot get private member profile picture and its name into this table.
My code is as below;
import wixData from 'wix-data';
$w.onReady(function () {
$w("#table1").columns = [{
"id": "col1",
"dataPath": "sahibi",
"label": "Çalışan",
"type": "string"
},
{
"id": "col3",
"dataPath": "ToplamPuan",
"label": "Toplam Puan",
"visible": true,
"type": "number"
}
];
wixData.aggregate("StarStarar")
.sum('puan', 'ToplamPuan')
.group("sahibi")
.descending("ToplamPuan")
.run()
.then((results) => {
let items = results.items;
let numItems = results.length;
let hasNext = results.hasNext();
console.log(numItems)
console.log(hasNext)
console.log(items)
$w("#table1").rows = items;
const starstarar = results.items.map(x => x.puan)
.filter((obj, index, self) => index === self.indexOf(obj));
const aggregated = starstarar.map(x => {
return {
sahibi: x,
puan: results.items.filter(obj => obj.sahibi === x)
.map(z => z.puan)
.reduce((sum, current) => sum + current)
}
})
console.log(aggregated)
$w("#table1").rows = aggregated;
})
});
Please help me to get private member name and profile picture in to this table with code. Thanks…