In this case, add a boolean value in the same data set ( oldUsers ) i called it detailsFilled , then add another condition to the Query, so your code should look something like this:
wixData.query("oldUsers")
.eq("userId", user.id)//check if the user id exist
.eq("detailsFilled", true) // check if the details is filled out (True)
.find()
.then( (results) => {
if(results.items[0]){ //if the user id exist and the detailsFilled is True
console.log("Not the first time,and details filled before");
$w("#lightBox").hide();
}
Note that you have to store the boolean value for the member who filled the details.
- just after submission/filling the details, get the user id and insert it to the DS and turn the boolean value to True.
Best,
Mustafa