I have 3 collections: Members, Tournaments, TxResults
TxResults contains a reference field named Tournament mapped to the TxID field that is in the Tournaments collection as well as a reference field called Member for the field Member Name in Members.
I have added a table to the page connected to the TxResults dataset, then created a dropdown connected to the Tournaments dataset to display a field called Location. Location is NOT a reference field in TxResults, but the TxID is.
What I would like to have happen is when the Location is selected (because it is more human-readable than the TxID) from the dropdown, the table is filtered to display TxResults for only that TxID.
Right now, the options in the dropdown is populating correctly, but when I select a Location, the table refreshes and there are no results.
This is what I have in my dropdown event:
export function Txdropdown_change(event) { $w("#Txdataset").setFilter(wixData.filter().contains("Tournament", $w("#Txdropdown").value)); }
Does anyone know if what I would like to do is possible?
I have tried following all of the Wix tutorials on YouTube regarding datasets and I also followed the one from Code Queen with using multiple dropdowns but that is not quite what I need.
@poolshark314 The problem is that after setting a filter on the Txdataset it will only have the filtered item - and that's what's being used to populate the dropdown.
To solve your problem, you need two datasets connected to the Tournaments dataset (Txdataset). One that is not filtered and is used to populate the dropdown, and the existing dataset that is filtered by the dropdown value, which is then used to filter the results.
how we can set multiple filters on single export function input_change(event)
Yisrael,
Thank you the reply. That is a very good point and I have corrected this, however it is still not working. Any other suggestions?
Make sure that you are using the field key and not the field name.
Not this: Tournament
But this: tournament