How can I display the results of DataQuery count ( )

Hi Yisrael, your code helped me a bunch! Thank you so much!

But I’ve got another question, what if I want to display a different message if the count is 0? How do I do that?

This is my code currently.

wixData . query ( “Recall” )

. eq ( “title” , $w ( “#vininput” ). value )
. find ()
. then ( res => {
$w ( “#recalltable” ). rows = res . items
$w ( “#recalltable” ). expand ()

});
wixData . query ( “Recall” )

. eq ( “title” , $w ( “#vininput” ). value )
. count ()
. then ( ( num ) => {
let numberOfItems = num ;
$w ( “#textresult” ). text = “You have " + num + " recall ongoing. Please contact Suzuki Malaysia Sdn. Bhd. Glenmarie Shah Alam Office at 03-5566 5688 for any enquiries. Thank you.” ;

$w ( ‘#textresult’ ). show ();

})
. catch ( ( error ) => {
let errorMsg = error . message ;
let code = error . code ;

});
}