@prabhavp380
Surely you would be able to solve this issue without any coding, by sorting your Db with help of the DATASET. But i prefer to work the coding way, because this way is always more flexible one.
So, your steps in this case should be…
- First quering your DB
- Filtering for the right value in the right data-field.
- Find all possible / matching results.
- Then get the output.
- And populate a table, a dropdown, or a repeater with the output-data.
You will need something like this…
import wixData from 'wix-data';
$w.onReady(function() {myFunction()});
function myFunction(){
let FIELD = "YourFieldIDhere"
let VALUE = $w('#YourInputFieldhere').value
wixData.query("IdOfYourCollectionHere")
.eq(FIELD, VALUE)
.find()
.then( (results) => {
if(results.items.length > 0) {
let items = results.items; console.log(items)
}
else { console.log("No entries found!") }
})
.catch( (err) => {let errorMsg = err;});
}