[RESOLVED] conflicting query results

OK so this one is, as they say, a doozy!
I have a number of elements on a page set to display after series of if statements check all the requirements for each element. Within these if statements are a few queries which use the .eq option to ensure the results being returned are for the logged in user only [.eq(“email”, userEmail)].
The page also displays data from a dataset (connected to the same data that is eventually queried if certain conditions are met). I know this all sounds confusing but here’s the fun part:
A member could have the status of either a student, teacher, or official in this database. There’s an input field on the page connected to the dataset that holds that information and it is set to autofill from the dataset. This works as it should.
When I query the dataset and console.log the results I get a different result (keep in mind the results are filtered by email). And when I check the actual live database I get the correct information that autofills. Take a look at the screen shots below:
Here you see the autofill working as it should. Remember this input is linked to a dataset, no coding for this.


Next you see in the database where we can confirm that his status is indeed set as Teacher:


Here’s the code (note that I had to set it to read the input value because setting it to read the value for the proper field in the query results resulted in absolutely nothing happening):


And finally, here’s the console results of the above code:


Sorry for the lengthy post but I didn’t even know how to begin putting this into words.
Any ideas?

Not really sure what you’re doing, but it seems that you have your form connected to a $w.dataset and you are also doing a query on the same collection as the dataset. You might have a conflict. I would recommend checking your database API usage and making sure that one thing doesn’t stomp on another.

If you continue to have problems, please post the URL of your site. Only authorized Wix personnel can get access to your site in the editor. Please include the name of the page involved.

Thanks for your help with this. I restructured the databases on my site so I’m no longer having this problem. I believe it was caused by a conflict in IDs so that the email being stored in the userEmail variable, and thus used for the query, belonged to another member.

Thanks for the quick reply on this.