We have a survey we are creating in 2.0 tools with numerous multi-level lists. We’re calling on csv files, very much like the regions.csv file example in XLSX Converter documentation. However, our lists go beyond two levels. For example, we have state, county and, city data in a csv and need to select states, counties within states and then cities within counties. We also want each state, county, and city to show up only once in the select values in Survey. We’ve got the choice filters functioning, the first level to work, and the last is no problem, but intervening levels (e.g. county) have duplicates showing up.
Here’s what we’re using in the callback:
state:
“_.chain(context).pluck(‘state’).uniq().map(function(state){
return {name:state, label: state, data_value: state, display: {text:state}};
}).value()”
county:
"_.map(context, function(place){
place.name = place.county;
place.label = place.county;
place.data_value = place.name;
place.display = {text:place.label};
return place;
})
"
city:
"_.map(context, function(place){
place.name = place.city;
place.label = place.city;
place.data_value = place.name;
place.display = {text:place.label};
return place;
})
"
Various attempts to stick .uniq() in the state callback have been to no avail, since the array is unique even when the state is not.
Any help much appreciated.