Hi All,
I would like to say right off the bat that I am very new to Wix code and have very limited knowledge but am doing my best. I have been spending a solid afternoon on this problem and am about to throw this computer out of the window.
The idea is simple, query the database called ‘answers’ and search for the string ‘Serial Cleaner’ in the ‘Concept’ column. Then count those entries and convert to a string for display in a text object.
This all works fine except the text object returns 0 instead of the 2 items I have in that column.
Here is the code I am using:
import wixData from ‘wix-data’;
// …
export function text12_viewportEnter(event, $w) {
wixData.query(“answers”)
.eq(“Concept”,“Serial Cleaner”)
.count()
.then( (num) => {
let numberOfItems = num;
$w("#text12").text = "" + num;
} )
. catch ( (error) => {
let errorMsg = error.message;
let code = error.code;
} );
}
Any help would be greatly appreciated.