Question:
I have a dynamic page with a dynamic dataset connected to a database called “Reservations”. One of the fields of this dataset is called “itinerary” and contains the ID (_id) of one of the entries in another database called “Itineraries”. This Itineraries database also has a Dynamic page.
On the Reservations Dynamic Page I would like to create a button that links to the Itineraries Database page, and specifically to the Itineraries page that corresponds with the _id in the “Itinerary” field in the Reservations Database.
I created a dataset connected to the Itineraries Database (dataset2) and that sets to submit and open the dynamic itineraries page. With help of the below code I tried to filter the dataset2 to only select the itinerary that has the ID in the reservations database but it doesn’t work.
$w("#dataset2").onReady(()=>{
const itineraryid = $w("#dataset2").getCurrentItem()._id;
$w("#dynamicDataset").setFilter(wixData.filter().eq("itinerary",itineraryid));
});
Anyone any idea how I can achieve what I’d like to achieve?
Thanks a lot!
Product:
Wix Studio