Hi, Anthony! Thanks for your reply!
With your guidance, and although the API reference is invaluable, the only combination of anything that would display anything in the new “gene count” text field (#dropdownGeneCount) is the following snippet. Regardless of where I added the snippet, whether within onReady or within the dropdown onChange event handler, the result was the same. Adding the wixData.aggregate is what generated the text element to display something. Without it, nothing.
I know I’m missing something and it’s probably super simple. My frustration is probably getting the best of me, too.
wixData . query ( “SubtypesDataset” )
. eq ( “type” , $w ( “#TypeCategoryDropdown” ). value )
. eq ( “inheritancePattern” , $w ( “#InheritanceDropdown” ). value )
. eq ( “neuropathyType” , $w ( “#NeuropathyTypeDropdown” ). value )
. eq ( “chrmosomeShort” , $w ( “#ChromosomeDropdown” ). value )
. eq ( “geneName” , $w ( ‘#ChromosomeDropdown, #NeuropathyTypeDropdown, #InheritanceDropdown, TypeCategoryDropdown’ ). value )
wixData . aggregate ( “SubtypesDataset” )
. group ( “geneName” )
. count ()
. run ()
. then (( results ) => {
let geneTotal = results . items . length ;
if ( geneTotal > 1 ) {
$w ( '#dropdownGeneCount' ). html = `<span style= "font-family: Lato;
color: #457f8c;
font-size: 20px;
font-weight: normal;
letter-spacing: 1.6px;
font-variant: small-caps"> ${ geneTotal } </span>
<span style= "font-family: P22 Underground;
color: #457f8c;
font-size: 21px;
font-weight: normal;
letter-spacing: 1.6px;
font-variant: small-caps">Genes Match Your Search</span>` ;
}
$w ( "#dropdownResults" ). show ();
$w ( '#dropdownSearchButton' ). enable ();
$w ( '#loadingGIF2' ). hide ();
})
I’m working with a test site rather than my live site. I’ve verified the collection name is correct and I’ve verified the field names are correct. I’ve also made sure sandbox is synced to live.
In the screenshot, the combination of dropdown selections return “158 Subtypes…” This is correct for the dropdown options shown. The next line should then return “124 Genes…” It’s stuck at 50. The subtypes count changes as dropdown selections change and remains accurate. The gene count stays at 50, even when the above code snippet is within each of the dropdown onChange event handlers.
This next screenshot is the collection structure. There’s several dozen fields for each item. The dropdown filter counts the Subtypes field. I’m stuck at how to count the Gene Name field in relation to Subtypes count. As you can see in the screenshot, for example, “PMP22” in the Gene Name field appears twice. But, if the corresponding “CMT1A” and “CMT1E” are responsive to the user’s search inputs (dropdown selections, and there is also a text search input), I need “PMP22” to be counted only once for accuracy of “Gene Count” displayed in the text element. I tried using a .distinct, but the 50 count did not change.
What am I missing? What am I overlooking? I’m hoping you make me look like a fool. That would be the bees knees.
I greatly appreciate your time and help.

