Hello,
We are attempting to create an Arcade Expression where we are symbolizing off of 2 different fields. Both fields have domains. We are close but for some reason, the 'Canceled' from the Project_Status domain isn't registering. All of the other values which are from the Project_Type domain are showing up. We want the symbology to be where if a Project Status is Canceled, that is the primary option in the "Hierarchy" if such a thing exists. Right now, we have a test record where we have the Project Status set to 'Canceled' with the Project Type also filled out and the symbology is showing the Project Type. I am attaching the expression we have for reference.
Thank you
Solved! Go to Solution.
So I ended up just rebuilding the domain to have only text values instead of numeric codes and that solved the issue.
Have you double checked the domain name is actually "Canceled"?
Strong chance the underlying value is different in the domain or even for the test value (check the count against values when applying filters).
The name is 'Canceled' but the coded value is 11. I tried using the coded value 11 in the expression but it still bypasses it. I tried with double quotes, single quotes, and not quotes and still no luck.
Try returning only this line first and see what type and result comes
DomainName($feature, 'Project_Status')
Then maybe this whole expression could be simplified, with the project status on an if statement and a subsequent return of project Type?
if (DomainName($feature, 'Project_Status') == "Canceled"){
return "Canceled"
} else return DomainName($feature, "Project_Type")
There's nothing wrong with the expression from what I can see. When you base symbology on an expression, the symbology classes will be based on values present in the data.
Here's a layer with a variety of names in it. I can define all kinds of values in the expression:
But those won't show up, because they're not in the data itself. If I wanted to add them, I need to click the plus:
Ah, but you have a test record…
Is it just a typo? Cancelled can be spelled with two Ls.
So I ended up just rebuilding the domain to have only text values instead of numeric codes and that solved the issue.