Hi.
I am trying to setup the conditional filtering for a database
Each dropdown works except 1
The key field is correctly written in the code
Console log says that index 1 is undefined, however i have only two indexes in the database
Index 0 and index 2
How can i find out what is this index 1 and delete it
Already redone the database and the dropdowns with the same results
Code
function uniqueDropDown1 (){
wixData.query("DE")
.limit(1000)
.find()
.then(results => {
const uniqueTitles = getUniqueTitles(results.items);
$w("#location").options = buildOptions(uniqueTitles); //ERROR HERE
});
You will need to debug your buildOptions() function which is returning the null value for index 1.
Thank you for the reply.the best way to debugg it? I have added the console.log and returns that issue.
The index 0 and index 2 is real value in my database but not share what index 1 could be, any suggestion would be appreciated how to find out where the issue is
The console.log() is only displaying the returned values. You will need to determine what’s happening in the buildOptions() function to see why it’s returned a null value. You can add other console.log() statements in buildOptions() to see what’s happening. You should also check to see what the values are in uniqueTitles - perhaps one of those values is null and the problem is in the getUniqueTitles() function.