Unique symbols - add Types with Arcade

1013
4
05-16-2022 05:33 PM
Labels (1)
jessneuner
Occasional Contributor

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?

uniquesymbols_types.jpg

 

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!

jess

 

0 Kudos
4 Replies
RussRoberts
Esri Notable Contributor

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

RhettZufelt
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. 

RhettZufelt_0-1652800476493.png

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

 

R_

 

jessneuner
Occasional Contributor

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. 

RussRoberts
Esri Notable Contributor

You can now add values to the list of types. These values you are adding wont exist in the dataset yet but once added they will use the configured symbology. The added values do not get added to the types/templates of the layer and are ONLY used for layer styling.

Opening the Types smart mapping panel you will see this new '+' button

RussellRoberts1_0-1668431147608.png

 

Clicking that will open this modal where you set the stored value and display value. The display will autogenerate to the stored but you can edit that. 

RussellRoberts1_1-1668431203681.png

RussellRoberts1_2-1668431277508.png

Then it will appear at the bottom of the list above the 'Other' section

RussellRoberts1_3-1668431312852.png

 

Dragging the newly added value into the 'Other' section will remove it from the list entirely if no features contain that value. 

 

0 Kudos