Hi - I need to have a search function so users can search a dataset with their surname, and as a result the table number is displayed in the table below?
$w.onReady( function () {
} );
import wixData from ‘wix-data’
export function input1_keyPress(event) {
// Runs a query on the “TablePlan” collection
wixData.get(“TablePlan”)
// Query the collection for any items whose “Surname” field contains
// the value the user entered in the input element
.contains(“Surname”, $w(“#input1”).value)
.find() // Run the query
.then(res => { // Set the table data to be the results of the query
$w(“#table1”).rows = res.items;
});
Any help would be greatly appreciated!
Thanks!