Hello Community
I would like my arcade expression to return 'Yes' or 'No' instead of '1' or '0' within an if else and for loop clause in my pop-up. My expression is getting data from another feature layer, filtering that feature layer for matching unique ids with the current layer, and returning attribute information when a match is found. The 'mdca' attribute is a 1 or 0 and I would like to return Yes or No. Here is the expression:
var inspections = FeatureSetByName($map,"UCF Tree Inspections - UCF Tree Inspections")
var treeuniqueid = Text($feature["Grant_ID"]+"-"+$feature["Tree_ID"])
var sql = "Tree_UniqueID = @treeuniqueid"
Console(sql)
var inspection = Filter(inspections, sql)
var cnt = Count(inspection)
var history = ""
if (cnt > 0){
history = "inspections: " + cnt
for (var inspection in inspections){
var mdca = Text(inspection.MDCA_Correct)
history = "MCA Correct: " + mdca
}
}else {
history = " "
}
return history
I have tried to use 'Boolean' instead of 'Text' but then I get a return of 'false' for a 1 which is the opposite of what I want.
I have also unsuccessfully tried to use 'when' in several places.
Any help would be greatly appreciated. Thank you.
Francesca