Hi!
My polygon feature's outline color is rendered based on the proximity to an expiration date. My code works in ArcPro but when I share to AGOL as either a Web Map or Layer the code breaks and somehow the incorrect colors are rendered even though nothing about the arcade script changed. I've tried adding this expression in the web map itself and saving as a Web Layer from ArcPro to no avail.
Are arcade scripts for symbol property connections not supported in AGOL, or are they supported in some different capacity? Should i be iterating though each feature's expiration date manually in AGOL? Any information would help, posted below is my arcade script:
//if already expired
if (DateDiff(Date($feature.License_Expiration), Now(), 'days') < 0) {
return "#f01000" }
// if expiration is within the next 120 days return orange
else if (DateDiff(Date($feature.License_Expiration), Now(), 'days') > 1 && DateDiff(Date($feature.License_Expiration), Now(), 'days') < 120) {
return "#f0a800"}
//leave boundary black if expiration date is > 120 days out
else if (DateDiff(Date($feature.License_Expiration), Now(), 'days') > 120){
return "#000000"
}
//leave boundary black if !expiration date
else if ($feature.License_Expiration == Null){
return '#000000'
}
Solved! Go to Solution.
What you can do is use Arcade to return unique categories, which would look like this
if (IsEmpty($feature.License_Expiration)) return 'No Expiration Date'
var span = DateDiff(Date($feature.License_Expiration), Now(), 'days')
When (span < 0, 'Expired',
span < 120, 'Nearing expiration',
'Not expired')
And you would then set the outline colors in the Styles dialog
What you can do is use Arcade to return unique categories, which would look like this
if (IsEmpty($feature.License_Expiration)) return 'No Expiration Date'
var span = DateDiff(Date($feature.License_Expiration), Now(), 'days')
When (span < 0, 'Expired',
span < 120, 'Nearing expiration',
'Not expired')
And you would then set the outline colors in the Styles dialog
This worked, thank you for the solution that makes total sense.