Hi,
I have a point layer in a web map that I would like to symbolise using the sum of a field in a related table (1 to many join). So I have opened an expression in the 'Choose attributes' section of the Styles tab. There are some empty values in the field so I have tried to correct that in the script.
However, I am getting an error saying: "Test execution error: Execution error - Key not found - Possums. Verify test data.". I have checked the 'Possums' field and it is an integer field, and my spelling is correct.
Here is the script:
var relatedRecords = FeatureSetByRelationshipName($feature, '18', ['Possums'], true);
var value = $feature['Possums'];
if (IsEmpty(value)){
return 0
}
var sum = Sum(relatedRecords, 'Possums');
return sum;
Something that I'm not sure about is the name of the relationship class. I sourced it from here:
is that correct, and why is my script not working please? Many thanks