I have a text element that I would like to display the number of times an item appears in a column of a collection
the collection is called Leads
the text element is called pursuingNum
the collection field is called stage
and the item to count is called PURSUING
$w.onReady( function () {
//TODO: write your page related code here…
// Begin Number Counts
wixData.query(“Leads”)
.find(“stage”, “PURSUING”)
.then( (num) => {
let numberOfItems = num;
} )
. catch ( (error) => {
let errorMsg = error.message;
let code = error.code;
$w(“#pursuingNum”).text = numberOfItems;
} );
});