Unique symbols - add Types with Arcade

05-16-2022 05:33 PM
Labels (1)
New Contributor III

Hi folks -- 

We've got an arcade expression to distill a set of status fields into one so that we can have a more simple unique symbols renderer for our layer in the map. 

The arcade expression has several if statements that result in 4 possible outputs. BUT two of these outputs are very uncommon occurrences - the data is being updated through a geoevent feed. 

So my question -- is there a way to add values into the possible Types for the Unique symbols renderer?



Here's the arcade... 


if($feature["FLASH_STATUS"] == 'Comm_Failed' || $feature["FLASH_STATUS"] == 'On') {
   return "Flashing or Comm Failure";
} else if ($feature["PREEMPT_1"] == 'On' || $feature["PREEMPT_2"] == 'On') {
   return "Railroad Preemption";
} else if ($feature["PREEMPT_3"] == 'On' || $feature["PREEMPT_4"] == 'On' || $feature["PREEMPT_5"] == 'On' || $feature["PREEMPT_6"] == 'On') {
   return "Emergency Vehicle";
} else {
   return "Normal";


I'm thinking I can edit the source data for this one layer in this one map, but that's not a good overall solution for us.  What if we want to update other existing maps once we figure it out?  or we want to use the same approach with different data we can't fudge as easily... 

Thanks for any ideas you've got!



0 Kudos
3 Replies
Esri Frequent Contributor

This isn't possible yet but it is on our roadmap to add values to the types renderer that might not exist yet. 

MVP Frequent Contributor

I think you could copy the expressions for normal and flashing (the two that have results), but have them return Emergency and Pre-empt values.

Then, since these will now "exist", you can add them to the symbology and save it.  Then, remove the extra lines from the arcade.

Should show the symbology for these two, even if the count is zero. 


* I added I-8 long enough to create the symbology, then removed it.




New Contributor III

thanks folks!

We wound up using AGO Assistant to modify the web map json and include the over values.

The approach of adding or modifying existing records long enough for them to be discovered by the renderer also worked when that's an option. 

0 Kudos