Hello, I'm trying to write 1 arcade expression. In my table I have a field for Sunday; Monday; Tuesday; etc. The data is either a 1 if a work crew is at that location on that day or a 0 if they are not.
I want my expression to list the days of the week they are at each location but I'm only able to return the first instance with my formulas.
I tried and IF and Else IF statement
if($feature["USER_SUNDAY"] == 1)
{return " Su "}
else if($feature["USER_MONDAY"] == 1)
{return " M "}
else if($feature["USER_TUESDAY"] == 1)
{return " Tu "}
else if($feature["USER_WEDNESDAY"] == 1)
{return " W "}
else if($feature["USER_THURSDAY"] == 1)
{return " Th "}
else if($feature["USER_FRIDAY"] == 1)
{return " F "}
else if($feature["USER_SATURDAY"] == 1)
{return " Sa "}
And also tried a nested statement:
iif($feature["USER_SUNDAY"] == 1,'Su',
iif($feature["USER_MONDAY"] == 1,'M',
iif($feature["USER_TUESDAY"] == 1,'Tu',
iif($feature["USER_WEDNESDAY"] == 1,'W',
iif($feature["USER_THURSDAY"] == 1,'Th',
iif($feature["USER_FRIDAY"] == 1,'F',
iif($feature["USER_SATURDAY"] == 1,'Sa',NONE)))))))
I even tried replacing IIF with When but achieved the same result. The formulas only return the first day a crew is at a location and won't combine the days if they are there more than once in the PopUp.
Is this possible or do I need to create an expression for each day of the week and then add it to my PopUp?
Thanks!