hi guys i want to ask any of you can do multiple search in one search box its a quite difficult.
i tried many codes but still not functioning. HELP ME OUT GUYS
this is my default code for searching single item label.
import wixData from ‘wix-data’;
export function searchButton_onClick(event) {
let searchValue = $w(‘#input1’).value;
let searchWords = searchValue.split(’ ');
let query = wixData.query(‘CaffeBeneDBS’)
.contains(‘employeeName’, searchWords[0]);
query.find()
.then(res => {
$w(‘#table1’).rows = res.items;
});
}
Hey Jerone,
Welcome to Wix Code.
Since you have an array of search terms after doing the .split(), you can try either hasAll() or hasSome() .
Something like this:
let searchWords = searchValue.split(' ');
let query = wixData.query('CaffeBeneDBS')
.hasSome('employeeName', searchWords);
I hope this helps.
Yisrael
hi yisrael thanks for that advice i try your code and it works as for now i mix it with different terms
what iam looking as for now is is it possbile not to view anything in the table as long as the search box is filled with particular data that iam looking for. thanks
this is my code as for now.
import wixData from ‘wix-data’;
$w.onReady(function () {
});
export function pindot(roll) {
wixData.query(‘CaffeBeneDBS’)
.contains(‘employeeName’, $w(‘#input1’).value)
.or(wixData.query(‘CaffeBeneDBS’).contains(‘examinationResults’, $w(‘#input1’).value))
.or(wixData.query(‘CaffeBeneDBS’).contains(‘evaluatorsName’, $w(‘#input1’).value))
.or(wixData.query(‘CaffeBeneDBS’).contains(‘city’, $w(‘#input1’).value))
.or(wixData.query(‘CaffeBeneDBS’).contains(‘evaluationType’, $w(‘#input1’).value))
.or(wixData.query(‘CaffeBeneDBS’).contains(‘employeesDesignation’, $w(‘#input1’).value))
.or(wixData.query(‘CaffeBeneDBS’).contains(‘uniqueIdCode’, $w(‘#input1’).value))
.or(wixData.query(‘CaffeBeneDBS’).contains(‘storeName’, $w(‘#input1’).value))
.or(wixData.query(‘CaffeBeneDBS’).contains(‘date’, $w(‘#input1’).value))
.or(wixData.query(‘CaffeBeneDBS’).contains(‘employeesId’, $w(‘#input1’).value))
.find()
.then(res => {
$w(‘#table1’).rows = res.items;
});
}
hope you can help me.
How do I make a search filter for similar data
Used onclick button
Like
I have customer data entered on a daily basis and I would like to inquire about the number of customer-specific records that were repeated by mobile number during
I would like to have a table only for customers with more than one record