Hello! I'm trying to use Arcade to display text on a pop-up in Map Viewer. When I test the code within the new Arcade Editor, it works exactly as intended:
var lines = FeatureSetById($map, /* Sewer Line */ "184e8d5e05b-layer-7");
var bufferArea = Buffer($feature, 10, 'feet');
var intersectedLine = First(Intersects(lines, bufferArea));
var facilityId = '';
if(intersectedLine != null){
facilityId = intersectedLine.FACILITYID;
}
var cctvYears = FeatureSetById($map, /* SsTelevisedMains */ "184e8d5e05b-layer-8", ['LINETOPOINT', 'INSPECTION_DATE']);
var filteredYears = Filter(cctvYears, "SEGMENT_ID = '" + facilityId + "'");
var sortedYears = OrderBy(filteredYears, 'INSPECTION_DATE desc');
var lastYear = First(sortedYears);
var defects = FeatureSetByName($map, "SsCCTVConditions");
var LineToPoint = lastYear.LINETOPOINT;
var filteredDefects = Filter(defects, "LINETOPOINT = '" + LineToPoint + "'");
var topDefect = Filter(filteredDefects, "Grade >= 3");
var allDefects = '';
for(var d in topDefect){
allDefects = allDefects + "(" + d.Grade + ")" + " Type: " + d.PACP_CODE + " Distance: " + Round(d.DISTANCE, 2) + "\n";
}
return {
type : 'text',
text : allDefects //this property supports html tags
}
However, nothing shows up in the pop-up:
Based on my configuration, I assume the expression should be displayed above the Fields List and below the Title. Am I implementing the expression in the pop-up incorrectly? I can confirm that the same expression works in Field Maps and the newly implemented Forms in Map Viewer.