I've created an arcade expression that pulls species data from a related table. Instead of having Lower_Taxon as one of the listed attributes, I'm wondering if I can sort or group the list by it.
This is my current code:
var relatedrecords = FeatureSetByRelationshipName($feature,"Provincially_Tracked_Species_Detail_CRCA");
var popupString = ""
for (var f in relatedrecords){
popupString += Text(f.Com_Name) + TextFormatting.NewLine +
"Scientific Name: " +
DefaultValue(f.Sci_Name, 'no data') + TextFormatting.NewLine +
"Taxon: " +
DefaultValue(f.Lower_Taxon, 'no data') + TextFormatting.NewLine +
"SARO Status: " +
DefaultValue(f.SARO_Status, 'no data') + TextFormatting.NewLine +
TextFormatting.NewLine
}
return popupString
This is what the results look like now:
And this is what I'm hoping for them to look:
Please let me know if you have any suggestions on how to accomplish this.