I have a feature class that I joined with a table in Portal, by clicking on Analysis>>Summarize Data>>Join Features. This is a one to many join.
When I try to write my symbology Arcade expression, it will not find a feature that has both values (there are features/parcels that have both values after the join). Any ideas?
if( $feature["media_type"] == 'Curb Tie' && $feature["media_type"] == 'Building Inspector Curb Tie') {
return "Curb Tie"
}
Would you be able to share your data/attribute table so we have a better idea of the join structure?
OK, the expression is done on a per row basis, so would never evaluate as True for an AND expression of equality for different attribute values.
Why not an OR expression or is there more to this?
if( $feature["media_type"] == 'Curb Tie' || $feature["media_type"] == 'Building Inspector Curb Tie' ) {
return "Curb Tie"
}
Thanks David. I do need to evaluate by geometry or by the relfeatureglobalid field, which features have both 'Curb Tie' and 'Building Inspector Curb Tie'.
I would recommend by evaluating by the original GUID or ObjectID field as it will be less computationally expensive than a geometry operation. I'll leave this for someone else as I'm not to sure how best to go about this, but it seems like a nightmare. Guessing you don't have desktop to do a one-to-one join and join attributes instead?
Hi @KellyArmstrong ,
The Join Expression should be a condition that evaluates to true or false (you don't need to return anything). If the condition is met, the features will be joined, if it's not, they won't be joined. Currently your expression is trying to return a result, which isn't the intended use. From the doc here:
Expressions are used in the Join Features tool to specify join conditions.In some cases, you may want to specify a condition to select features that should be included in the join.
....
A join condition must always result in true or false. Expression examples are included in the sections below.
You will also need to specify $target + $join instead of $feature - to specify which datasets + field you are using. So something like: ($target['media_type'] == 'Curb Tie') && ($join['media_type'] == 'Building Inspector Curb Tie')
But it seems like just applying a filter on your input layer will meet your needs and is simpler, since it sounds like you only want to join features with specific values. You can do this by clicking the "filter" button under the layer in your map, filtering for features where media_type = Curb Tie on one layer, and the other layer has curb type Building Inspector Curb Tie.
Please let me know if you have any follow up questions,
Sarah Ambrose
Product Engineer, GeoAnalytics
Sarah,
I guess I am confused. I already have the feature class and table joined - one to many.
I am just trying to symbolize features that have both "Curb Tie" and "Building Inspector Curb Tie" with the same globalid...
Oh sorry - I thought you were trying to use the join expression in the Join Features tool. Don't pay attention to my answer, it was about using the join expression parameter in the GeoAnalytics tool join features. I didn't realize you were trying to do symbology on a layer 🙂