this is what I have currently. I’ve counted many times, there are 8 cities and 10 shows up…
@russian-dima
wixData.query("Faith-basedorganizations")
.distinct("city")
.then((results) => {
if (results.items.length > 0) {
let items = results.items;
let firstItem = items[0];
let totalCount = results.totalCount;
$w("#numCities").text = totalCount.toString();
} else {
// handle case where no matching items found
}
})
.catch((error) => {
let errorMsg = error.message;
let code = error.code;
});