I'm looking for an arcade expression for arcgis pro symbology. Involves the Asset ID field to symbolise based on text within an asset ID.
Say if the asset ID contains C2
then blue (for instance), or if the asset ID contains C1
, C3
or GAS
, so on and so forth.
Imagine a treatment plant with lots of pipes of different colors all based off different common text within the asset ID.
How would the arcade expression look if trying to achieve this?
UPDATE: I have removed some comments and text that were confusing.
UPDATE: i am using the code below as a symbology expression with limited success, I'm sure there is a better code for what i am trying to achieve. any help is appreciated.
var disp_txt = $feature.ASSET_ID
if (Find("-C2-", disp_txt, 0)>-1) {
return "C2";
} else if (Find("-C3-", disp_txt, 0)>-1) {
return "C3";
} else if (Find("-C1-", disp_txt, 0)>-1) {
return "C1";
} else if (Find("GAS", disp_txt, 0)>-1) {
return "BIOGAS";
} else if (Find("RS", disp_txt, 0)>-1) {
return "RAW SLUDGE";
} else if (Find("DSL", disp_txt, 0)>-1) {
return "DSL";
} else if (Find("AIR", disp_txt, 0)>-1) {
return "AIR";
} else if (Find("-G-", disp_txt, 0)>-1) {
return "GRIT";
} else if (Find("PD", disp_txt, 0)>-1) {
return "PLANTDRAIN";
} else if (Find("TD", disp_txt, 0)>-1) {
return "TANKDRAIN";
}