So I need to symbolize based on two attributes: the INSP_STATUS and the Subtype. If there is no INSP_STATUS (ie. = null), than each subtype will have a different symbol.
But....if there is an INSP_STATUS (ie. a few different options), than regardless of the Subtype, they can all be the same symbol. This is what I have so far....a symbol for each subtype:
When I try to add a custom value with some conditional statement for the "YES" INSP_STATUS to cover all of the sybytpes, I just get an error:
Does anyone know how to accomplish this?? Or do I just need to make a symbol for every possible combination of INSP_STATUS and Subtype??
Solved! Go to Solution.
Here is the final product. It's working nicely!
// for features without INSP_STATUS, return the subtype
if(IsEmpty($feature.INSP_STATUS)) {
var subtypes = ["MaintenanceHole", "InspectionMH", "BackFlow", "DiversionMH", "FlapGateMH"]
var i = $feature.SubtypeCD - 1
return subtypes[i]
}
// for features with INSP_STATUS = YES
if ($feature.INSP_STATUS == "YES")
{
return "YES"
};
// for features with INSP_STATUS = WR LOW
if ($feature.INSP_STATUS == "LOW")
{
return "LOW"
};
// for features with INSP_STATUS = WR HIGH
if ($feature.INSP_STATUS == "HIGH")
{
return "HIGH"
};
// for features with INSP_STATUS = CR
if ($feature.INSP_STATUS == "CR")
{
return "CR"
};
Hi @JohannesLindner . Sorry to bug you yet again, but after setting up this Arcade powered symbology and publishing this feature class as a hosted feature layer in our Enterprise ArcGIS Online account, a lot of the symbols are not actually showing. The ones with an INSP_STATUS do show up, but the ones with no INSP_STATUS are just not visible. They are there, as evidenced by the labelling, but you just can't see them.
Does ArcGIS Online/Portal not support Arcade expressions?? Even using the web layer directly in ArcGIS Pro, I see the same results.
Click Edit Layer Style and their should be a botton to toggle on off for Show features out of range or no values. Set it to on.
You may have to experiment with different styles before you see that option
That doesn't seem to be an option for me. Maybe because I'm using an Arcade expression for the symbology? And the features are there. You can see the labelling. They just aren't being symbolized.
The one I did I used the Counts and Amounts (color) style but I had created a style in ArcGIS Pro and then uploaded it to ArcGIS Online. Took a little experimenting and a few curse words but I figured it out.
Hmmm... No idea why the symbology wouldn't translate to AGOL correctly. Try to change it in the MapViewer (just copy your expression) that worked for me.
Hi @JohannesLindner . So I think I see why my symbology in AGOL isn't working, but I can't really explain why. So, it looks like when I share my data as a weblayer out of ArcGIS Pro, the INSP_STATUS field on the data is getting upated. I do have Attribute Rules on the related table that has the inspections information. Do you think for some reason that is getting triggered when I share the data? Otherwise, I don't understand how that INSP_STATUS field is getting populated.
In my Attribute Rule, I have it set to update the INSP_STATUS in the parent records field whenever a new inspection record is created/updated. For some reason, I am seeing all records in the published hosted feature layer with that attribute populated.
Here is ArcGIS Pro:
And then the same feature in AGOL:
Ha ha!! Ok @JohannesLindner I finally got it working. Apparantly when you set a DEFAULT value on a field when you share that to AGOL, it automatically populates all the <Null> values with that default value....at least that seems to be what is happening....so NOT the Attribute rules.
Anyways, all is good now and the Arcade symbology is working ok.
Apparantly when you set a DEFAULT value on a field when you share that to AGOL, it automatically populates all the <Null> values with that default value
Huh, good to know.
Glad you got it working, please mark the correct answer so this question is shown as solved.