Yes, like i always say - - > everything is possible.
- Create first all your 12 or more DATABASES. Everything starts with the structure of your DBs.
- Create your CODE including all needed functions…
First import the WixData-API into your page (project)
import wixData from 'wix-data';
Next step, call the onReady-method…
$w.onReady(async function() {...........});
Declare all your DBs as variables inside an ARRAY…
let myDB s= ["collectionID1", "collectionID2", "collectionID3", ...............]
Also declare your used DATABASE-FIELDS…
let myDBFields ["dbField1", "dbField2", "dbField3", "dbField4"];
When you have done everything the right way, your code should look like the following one…
import wixData from 'wix-data';
let myDBs= ["collectionID1", "collectionID2", "collectionID3"];
let myDBFields = ["dbField1", "dbField2", "dbField3", "dbField4"];
$w.onReady(async() => {console.log("Page is ready...");
let myQuery1 = wixData.query(myDBs[0]);
myQuery1.find()
.then((res)=>{console.log("RESULTS: ", res.items);})
.catch(()=>{});
});
Do the same again, but instead of - → myDBs[0] ← - use - → myDBs[1]
import wixData from 'wix-data';
let myDBs= ["collectionID1", "collectionID2", "collectionID3"];
let myDBFields = ["dbField1", "dbField2", "dbField3", "dbField4"];
$w.onReady(async() => {console.log("Page is ready...");
let myQuery1 = wixData.query(myDBs[1]);
myQuery1.find()
.then((res)=>{console.log("RESULTS: ", res.items);})
.catch(()=>{});
});
This is just the first step → BASIC CODE to work with Wix-Data.
Expand your code adding forther LOGIC and FUNCTIONALITY, for xample adding - - > eq(dbField, VALUE)
import wixData from 'wix-data';
let myDBs= ["collectionID1", "collectionID2", "collectionID3"];
let myDBFields = ["dbField1", "dbField2", "dbField3", "dbField4"];
let myValue;
$w.onReady(async() => {console.log("Page is ready...");
$w('#myDropDownIDhere').onChange(()=>{
myValue = $w('#myDropDownIDhere').value;
});
let myQuery1 = wixData.query(myDBs[0])
myQuery1.eq(myDBFields[0], myValue)
.find()
.then((res)=>{console.log("RESULTS: ", res.items);})
.catch((err)=>{console.log(err);});
});
Now your DropDown, comes into game.
Try to understand the logic behind and how to complete your task.
Which further steps are needed ???
And do not forget to use the → CONSOLE <— it will help you to generate your code.
Another idea…
and another one…
https://www.wix.com/velo/reference/wix-data/wixdataquery/include