No results found text to display for nothing found in a database help

Hello guys/girls as above i’m trying to make a text display when no search results are found in a database, the search input would be made on one page when a search button is clicked and then navigates over to a second page where i would like the text to appear,

Thanks in advance

Hi,

If you’re using datasets, call ‘getTotalCount’ and display the message if it equals to zero.
https://www.wix.com/corvid/reference/draft/wix-dataset.Dataset.html#getTotalCount

if ($w("#dataset").getTotalCount === 0) {$w("#noResultsText").text = "no results" } 

If you’re using wixData query, use items.length as can seen here
https://www.wix.com/corvid/reference/draft/wix-data.WixDataQueryResult.html#length

Thanks Ido i have sorted it now thanks to you, that was bugging me for a while now :slight_smile:

thanks again