Hello, I am trying to add styling to my polygon layer using values in two different fields. I am new to Arcade and a coding amateur at best. I can get it to work by adding another duplicate layer to my web map and colouring it green if there's something in the Date field, but I want to avoid having to add extra un-necessary layers/complication to my web map.
So, to summise:
Field 1 - To Be Assessed - This is a Y or N text field - pre-populated.
Field 2 - Date Assessed - This is a Date Field - empty to start with, to be filled in by the surveyor.
-----------------------------------------
If field 1 = Y - colour polygon RED
If field 1 = N - colour polygon BLUE
If field 2 is not null, or has a date in it, colour polygon GREEN
So far I have got as far as the below but I am not getting it to work:
----------------------------------------
var survey = $feature['Survey_2024'];
var result = "";
If (IsEmpty(survey)) {Console("SURVEY=?");}
else if (survey == 'N') {result += "NO SURVEY";}
else {result += "YES - SURVEY REQUIRED";}
if (isEmpty($feature.Date_Assessed)) { } else
{result += "COMPLETE";}
result = Trim(result);
if (result=="") {
result = "No Data";
}
return result;
Grateful for any help! Many thanks, Harry