Esri Arcade Labeling Expression
Finds related records between two layers in a web map.
var aTable = $feature.aTableAttributeID;
var relate = "bTableAttributeID = '" + $feature.aTableAttributeID + "'";
var bTable = FeatureSetByName($map, 'bTableNameInWebMap');
var match = Filter(bTable, relate);
var cnt = Count(match);
var info = "";
if (cnt > 0) {
info = cnt + " Related Record(s) Count:";
for (var matches in match) {
var b_text = TextFormatting.NewLine + matches.someAttribute + ": " + "<a href=http://linkToImageDirectory.com/folder" + matches.imageLinkField + ">" + "link </a>" + TextFormatting.NewLine;
info += b_text;
}
} else {
info = "No related records";
}
return info;