I am trying to query a database in my website to filter a table. When I run the query in preview no results or errors are returned in the console. However if I check the console in the live site I get the following error
wixCode Uncaught (in promise) Error: The Test_DB2 dataset collection does not exist. You cannot work with a collection using the Data API before it is created in the Editor.
I have added the collection to the page and other elements on the page are using this database and it works just fine. I have also tried querying other databases in my website but get the same error every time.
Is there any reason this may be happening?
Thanks!
Hi!
Please share a link to your site so one of us, the Wix Code team, can inspect it and provide you with a solution.
Doron.
Hi Doron,
Did you have a chance to look at this website?
Hi!
After looking into your site I have found the following issues:
- The actual reference name of the dataset is #dataset2 and not “Test_DB2 dataset” as it is used later.
- The DB that the said dataset is connected to does not exists.
- This bit of code should work if we talked about querying a data base. Data sets are used to connect data
using Databinding .
Here are some articles to help you get your database-dataset concept straight.
About Database Collections
About Datasets and Connecting Data
WixDataQuery
Hope it helps!
Doron.