Hello experts,
I am new to Wix and am trying to find a way to quickly build a page where users are able to select some options. As an example if the user selects a primary key value, I should be able to query WixDB and select a unique record and populate another field on the page.
Below is sample code I tried -
wixData.query("plans") .eq("primaryKey",$w("#text15").text) .find() .then( (results) => { console.log(results.totalCount) "Should return only 1 row as it's searching primary key
firstItem = results.items[0],
}
Hello Tanya,
What you are trying to do is...
FILTER my DATABASE by a SELECTED-VALUE (for example from a DROPDOWN) and populate (for EXAMPLE a REPEATER) with the founded RESULTS.
Is this what you want?
1) Instead of a DropDown, you could also use for example an inputField.
A TEXT is surely not the best practice, how to do it 😁.
Here on my site you will find a lot of examples. I am sure you will also find an example which is very similar to your own needs.
Just take a look..... (examples with filtering-processes)
https://russian-dima.wixsite.com/meinewebsite
If you do NOT find the right example, which will help you to solve your problem, then you come back again here and ask again. 😉