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";
}
Thanks for any ideas you've got!
jess
This isn't possible yet but it is on our roadmap to add values to the types renderer that might not exist yet.
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.
R_
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.
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
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.
Then it will appear at the bottom of the list above the 'Other' section
Dragging the newly added value into the 'Other' section will remove it from the list entirely if no features contain that value.