yes, I’m using an html-comp.
$w.onReady( function () {
//TODO: write your page related code here…
$w(“#dataset1”).onReady( () => {
$w(“#dataset1”).getItems(0,2).then((result) => {
var CTypes=[];
var CTypesCount=[];
var CStages=[];
var CStageCount=[];
var OPNames=[];
var OPNameCount=[];
result.items.forEach( function (item){
console.log(item)
var CTLoc=CTypes.indexOf(item.contractType.title);
if (CTLoc<0) {
CTypes.push(item.contractType.title);
CTypesCount.push(1);
} else {
CTypesCount[CTLoc]++;
}
var CSLoc=CStages.indexOf(item.contractStage.title);
if (CSLoc<0)
{
CStages.push(item.contractStage.title);
CStageCount.push(1);
} else {
CStageCount[CSLoc]++;
}
var OPNLoc=OPNames.indexOf(item.otherPartyName);
if (OPNLoc<0)
{
OPNames.push(item.otherPartyName);
OPNameCount.push(1);
} else {
OPNameCount[OPNLoc]++;
}
});
$w(“#html1”).postMessage([CTypesCount.length].concat(CTypesCount).concat(CTypes).join());
$w(“#html2”).postMessage([CStageCount.length].concat(CStageCount).concat(CStages).join());
$w(“#html3”).postMessage([OPNameCount.length].concat(OPNameCount).concat(OPNames).join());
});
});
});