Hello, I have never used the Wix Code much, but that's going to change soon, after I figure out what's wrong here. When I try to load the code on one of my pages, with no issues from what I see, it says "loading the code for this site/[page name]" and stays that way permanently, and the code won't work. I have no idea how to debug it either, so any help would be great!
![](https://static.wixstatic.com/media/a27d24_0d805783509e46d1a43f8159386c685d~mv2.png/v1/fill/w_49,h_7,al_c,q_85,usm_0.66_1.00_0.01,blur_2,enc_auto/a27d24_0d805783509e46d1a43f8159386c685d~mv2.png)
![](https://static.wixstatic.com/media/a27d24_2e45233d17e14fc182e40dbc41649369~mv2.png/v1/fill/w_49,h_8,al_c,q_85,usm_0.66_1.00_0.01,blur_2,enc_auto/a27d24_2e45233d17e14fc182e40dbc41649369~mv2.png)
![](https://static.wixstatic.com/media/a27d24_de685d6c5d8448e7a42ed35c17ea92a5~mv2.png/v1/fill/w_49,h_8,al_c,q_85,usm_0.66_1.00_0.01,blur_2,enc_auto/a27d24_de685d6c5d8448e7a42ed35c17ea92a5~mv2.png)
Andreas Kviby: Sorry for the even later reply, but the period "." is getting the error "Parsing error: Unexpected Token"
Thanks for the help.
.then(res => {
console.log(res.items); // This will console log your items so you can see if you get hits
Tal: I am unsure how to do that, can you please explain?
Thank you so much for helping!
Maybe you don't get results when querying the second query. Have you tired console.log the res variable?
Tal: Really sorry about the really late reply, but I tried the new code and it still doesn't do what it's supposed to. The code has no errors and responds the same as before. Do you have any other ideas? Thank you for helping.
Hi,
Try to refresh the table after assigning the table rows:
import wixData from 'wix-data'; export function searchField_keyPress() { wixData.query('Coaster_Inversions') .contains('Title', $w('#iTitle').value) .or(wixData.query('Coaster_Inversions') .contains('Description', $w('#iTitle').value)) .find() .then(res => { $w('#table1').rows = res.items; $w("#table1").refresh(); }); }
Tal: I added the refresh code, with no errors, but the code still doesn't do anything to the page, still saying
import wixData from 'wix-data'; export function searchField_keyPress() { wixData.query('Coaster_Inversions') .contains('Title', $w('#iTitle').value) .or(wixData.query('Coaster_Inversions').contains('Description', $w('#iTitle').value)) .find() .then(res => { $w('#table1').rows = res.items; }); $w("#table1").refresh(); }
There's a link to the documentation with an example on my previous reply :)
(Sorry for the late reply)
Andreas Kviby: Yes, nothing happens when I enter data into the search field. #iTitle is just what I call the #searchField. I removed the first .or, while it doesn't fix the issues, it does clear up some text so thank you for that.
Tal: How do you refresh the table after setting the rows?
Hi,
Have you tried refreshing the table after setting the rows to the table?
Tal.
So if you enter some string in the text input field searchField nothing happens? You could also take away the first or because it is the same as the first .contains condition. Then I wonder what the field #iTitle is, are you sure that is a field and that you don't want to modify that to $w("#searchField").value ?