Hi, I'm starting to apply Arcade more in Map Viewer pop-ups and symbology. I can't figure out what I've done wrong here. Everything looks ok when I test this, except for when I have 5 "To do"s, the output doesn't show as "To do" as it should. It instead shows as "In progress".
I think the error is in line 15-17.
/*Statuses: To do, In progress, Complete as possible, 100% complete
To do - If any To dos, output To do
In progress - If there is an In progress, output In progress
If no To dos, In progress or not all Completes, output Complete as possible
100% Complete - If all equal Complete, output 100% Complete
*/
var checklist = $feature["Checklist_Status"]
var consent = $feature.ConsentFormStatus
var occupier = $feature.OccupierComplete
var owner = $feature.OwnerComplete
var water = $feature.WaterIntakeFormStatus
//To do - If any To dos, output To do
If (checklist == "ToDo" && consent == "To do" && occupier == "To do" && owner == "To do" && water == "To do"){
return "To do"
}
//In progress - If there is an In progress, output In progress
else if (checklist != "ToDo" || consent != "To do" || occupier != "To do" || owner != "To do" || water != "Pending"){
return "In progress"
}
//100% Complete - If all equal Complete, output 100% Complete
else if (checklist == "Complete" && (consent == "Complete - Eversign" || consent == "Complete - Manual" || consent == "Complete - Survey123") && (occupier == "Yes" || occupier == "Owner is occupier") && owner == "Yes" && (water == "Complete - Eversign" || water == "Complete - Manual" || water == "Complete - Survey123")){
return "100% Complete"
}
else {
return "Complete as possible"
} I'm hoping to apply this as a field in the pop-up, as an expression for symbology and dynamic content in ExB's text widget.
Also, as I'm still early in my Arcade journey, if you notice there's a better way I could be doing this, please point it out.
Thank you in advance for your help.