Trying to hyperlink to a website (var URL below) if the cabinet status is Active, I would like to return "available, please click here to sign up for service" with the "click here" acting as a hyperlink. The code works below without, but when trying to link it is just showing the full HREF code.
var intersectLayer = Intersects(FeatureSetByName($map, "HiLight Availability"), Buffer($feature, 0, 'feet'));
var zones = "";
var URL = "https://www.website.com";
if (Count(intersectLayer) > 0) {
for (var f in intersectLayer) {
if (f.CabinetStatus == 'Active') {
zones = 'available';
break; // Exit the loop if an 'Active' status is found.
} else if (f.CabinetStatus == 'Future') {
zones = 'anticipated for future development';
break; // Exit the loop if a 'Future' status is found.
} else if (f.CabinetStatus == 'Planned') {
zones = 'planned';
break; // Exit the loop if a 'Planned' status is found.
} else if (f.CabinetStatus == 'In Progress') {
zones = 'in progress';
break; // Exit the loop if an 'In Progress' status is found.
}
}
} else {
zones = 'not available at this address';
}
return lower(zones);
@Brian_McLeer - One way I have been able to do this by setting an attribute expression that is used with Text element in the pop-up.
Step 1 - Setting the attribute expression. Workout your conditional statements and the respective URLs.
example - I have used the below condition in the URL Links expression.
if ($feature.Dorian_2019 == "YES")
{
return "www.google.com"
}
else {
return "www.youtube.com"
}
Step 2 - Add a text element to the pop-up.
Insert the custom expression as a hyperlink.
Results -
Hope this helps 🙂