Trigger code to run on page when an event of site occurs

What I would recommend to do is this. Create an onChange handler for the dropdown. Then drag this handler onto your PAGE code from your SITE code (it should automatically go there first)

This will allow the code to run on a specific page and will negate the need to transfer information from SITE to PAGE. The result should look something like this:

export function yourDropdown_change(event) {
 // Add your code for this event here: 
 let input = $w('#dropdown').value
 
 wixData.query("yourDataset")
 .eq("field", input)
 .find()
 .then( (results) => {
     //the rest of your code here...
 })
}

You can then copy and transfer this to any pages you might need. By taking the handler from SITE and pasting it on PAGE it will trigger and run without needing to transfer any variables from SITE to PAGE.

Hope that helps!