Hi,
I’m trying to hide a text in my website if a field in a collection is not filled. This is my code:
import wixData from 'wix-data';
$w.onReady(function () {
//call to the collection named "Noir"
wixData.query("#Noir")
.find()
.then(results => {
//Verify if the field "account" is filled or not
if (results.items.length > 0 && results.items[0].account) {
//Show the text
$w("#text40").show();
} else {
//Hide the text
$w("#text40").hide();
}
})
.catch(error => {
console.error(error);
});
});
The console give me this error but I have te collection and I verify several times the name ID and all.
Error: WDE0025: The #Noir collection does not exist. You cannot work with a collection using the Data API before it is created in the Editor.
Anybody know what is my error?
Thanks a lot