Conditional User Input Drop Down not showing all data from dataset

I am currently building a form and one of the user input drop down is not showing all the data from the dataset (ie regions. only 5 out of 10 are showing). I presumed that maybe there were some issues with the CSV file used to populate the dataset, but after making sure that all is as it should be it is still not working as it should (i tried using a CSV file, MS DOS CSV file, a MAC CSV file but the same problem occurs). Anyone has any idea what could be the issue here?

Below is the code for the page:

import wixData from ‘wix-data’;

$w.onReady( function () {
populateRegion();
populateCommune();

});

function populateRegion(){

wixData.query(“Region2”)
.find()
.then(results => {
var uniqueList = createUniqueList(results.items);
$w(“#iptRegion”).options = buildOptions(uniqueList);
})

function createUniqueList(items){
var titlesOnly = items.map(item => item.region);
titlesOnly.sort();
return [… new Set(titlesOnly)];
}

function buildOptions (uniqueList){
var uniqueListFinal = uniqueList.map(curr => { return {label :curr, value:curr}; });
return uniqueListFinal;

}
}
function populateCommune(){

wixData.query(“Region2”)
.eq(‘region’,$w(“#iptRegion”).value)
.find()
.then(results => {
var uniqueList = createUniqueList(results.items);
$w(“#IptCommune”).options = buildOptions(uniqueList);
})

function createUniqueList(items){
var titlesOnly = items.map(item => item.commune);
titlesOnly.sort();
return [… new Set(titlesOnly)];
}

function buildOptions (uniqueList){
var uniqueListFinal = uniqueList.map(curr => { return {label :curr, value:curr}; });
return uniqueListFinal;

}
}

export function iptRegion_change(event) {
populateCommune();
$w(“#IptCommune”).enable();
}

Here is what the dropdown shows.

Here’s the CSV file used to populate the dataset

It’s because the default query is limited to 50 records and you have more than 50 rows in your collection.
To solve that, you should add to your query .limit(1000) before the .find() ;

But a better way to do it is to use .distinct(“region”) instead of a regular query:
https://www.wix.com/corvid/forum/corvid-tips-and-updates/example-remove-duplicates-from-connected-dropdown-options-using-distinct-query

Thank you J.D. Everything works fine now.