I have a column in my DB containing names: hotelRep
I have a text element on page which is displaying the name from another dataset HotelRepsDB
I want to count the amount of cells in the ArrivalsDatabase which contain the hotelRep name
import wixData from 'wix-data';
$w.onReady(function () {
getarr();
});
function getarr() {
let repname = $w("#repname").text;
wixData.query('ArrivalsDatabase')
.contains('hotelRep', repname)
.count()
.then( (num) => {
let numberOfItems = num;
num = $w("#ttlarr").text;
})
.catch( (error) => {
let errorMsg = error.message;
let code = error.code;
});
}
Its throwing no error but the value is 0