Hi ,
any one help in this regard,
having table with 5/6 column and want filter with & condition,
individual filter working fine
when run code there is no error but filter based on second condition, i.e brand , i want both conditon
export function input8_change(event) { // This function was added from the Properties & Events panel. To learn more, visit http://wix.to/UcBnC-4 // Add your code for this event here: const ram = wixData.filter().contains("ram", $w("#category").value) const storage = wixData.filter().contains("storage", $w("#brand").value) $w("#dataset1").setFilter(ram && storage); console.log('done');
@SHABIR KHAN
You're on the right track attempting to chain filter statements together, but there is a syntax issue with the above. Try this approach instead.
let ram,storage; let filter = wixData.filter(); ram = $w("#category").value; storage= $w("#brand").value; if (ram){ filter = filter.contains("ram", ram); } if (storage){ filter = filter.contains("storage",storage); } $w("#dataset1").setFilter(filter) .then(() => { console.log("Dataset is now filtered."); })