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?