How do you put Multiple collection on one page?
I have an Organization that changes Officers and Positions frequently. I would like to create a dynamic ( add - delete {I realize I’ll have to update my member collection for this}) a dropdown box to select a Position from a collection and than have a dropdown box to set that position in a collection of members to the Organization.
Hi Ray,
Welcome to the Wix Code Forums. Glad to have you aboard.
There is no problem accessing multiple collections. You can either do this by connecting components to a collection using a dataset , or through direct queries which specify the collection:
let firstItem;
let secondItem;
wixData.query("myCollection")
.find()
.then((results) => {
firstItem = results.items[0];
wixData.query("myCollection")
.find()
.then((results) => {
secondItem = results.items[0];
})
.catch((err) => {
let errorMsg = err;
});
})
.catch((err) => {
let errorMsg = err;
});
For complete details, read all about Database Collections.
Have fun,
Yisrael
Thanks, appreciate info