Hi, could someone help with my query. When the user fills in a word and click search, the query should search for a identical match in the database. I already tried several options but they all failed. When succeeded, the user should see a message “OK”, when not succeeded, they should see a message “Nothing found”.
This is my code, I tried several alternatives but they all failed. Thanks in advance for the help.
iboxcode: name of the input box
Boxcodes: name of the database
title: name of the colomn where the query has to search
resultbox: the text box that should contain the message for the user
Levi, Javascript/Wix Code is case-sensitive. I’m wondering if the collection “Boxcodes” is actually lower case “boxcodes”. A query will return nothing, even when it seemingly should, if that is not correct.
wixData.query("yourDataset")
.contains("field", "text")
.find()
.then( (results) => {
//whatever you want to do with the results here
})
this example query would search my database “yourDataset” for any string matching text (not case sensitive so TEXT, TeXt, etc will all match including TEXTING or any results that includes the word “text”) in the field “field”.