Select to view content in your preferred language

Arcade Expression Symbolizing from more than one field with Domains

916
6
Jump to solution
10-15-2024 03:18 PM
a_bakiera
Occasional Contributor

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

0 Kudos
1 Solution

Accepted Solutions
a_bakiera
Occasional Contributor

So I ended up just rebuilding the domain to have only text values instead of numeric codes and that solved the issue.

View solution in original post

0 Kudos
6 Replies
ChristopherCounsell
MVP Regular Contributor

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

0 Kudos
AB22
by
Emerging Contributor

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.

0 Kudos
ChristopherCounsell
MVP Regular Contributor

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")
0 Kudos
jcarlson
MVP Esteemed Contributor

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:

jcarlson_0-1729088611916.png

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:

jcarlson_1-1729088659602.pngjcarlson_2-1729088702108.png

 

- Josh Carlson
Kendall County GIS
0 Kudos
jcarlson
MVP Esteemed Contributor

Ah, but you have a test record…

Is it just a typo? Cancelled can be spelled with two Ls.

- Josh Carlson
Kendall County GIS
0 Kudos
a_bakiera
Occasional Contributor

So I ended up just rebuilding the domain to have only text values instead of numeric codes and that solved the issue.

0 Kudos