Hi,
Thanks for taking time to read this. I am trying to create a search bar that can search either tutor name or course name. what I can think about is create an if, else statment to run different searching code. However the code doesn't work. Can anyone help me with this problem thanks.
// For full API documentation, including code examples, visit http://wix.to/94BuAAs import wixData from 'wix-data'; $w.onReady(function () { //TODO: write your page related code here... }); export function input2_keyPress(event) { let SearchValue = $w("#input2").value; if($w('#dataset1').setFilter(wixData.filter().contains("courseName" ,SearchValue))){ }//.or(wixData.filter().contains('tutorFname', SearchValue1)) else if($w('#dataset1').setFilter(wixData.filter().contains('tutorFname' ,SearchValue))){ } }
![](https://static.wixstatic.com/media/a27d24_17da94b209614102bac4e8e6cd73290c~mv2.png/v1/fill/w_699,h_536,al_c,q_90,enc_auto/a27d24_17da94b209614102bac4e8e6cd73290c~mv2.png)
![](https://static.wixstatic.com/media/a27d24_feaebdcf26a147489cc943e1b5dbf1eb~mv2.png/v1/fill/w_688,h_533,al_c,q_90,enc_auto/a27d24_feaebdcf26a147489cc943e1b5dbf1eb~mv2.png)