Hi there,
I have a point layer and three related tables in a collection map on Field Maps. In the form of one of the tables, I want a text field to auto fill based on what's in a text fields in the point layer. I'm brand new to using expressions in Field Maps, and so tried adapting the following from one of Esri's posted examples on Common calculated expressions, but get an error in Field Maps saying "Failed to calculate". Any help would be great. Thanks.
var related_features = FeatureSetByRelationshipName($feature, "Sept_Measure_Butternut_data_sheet", ["current_plant_source"], false) var related_feature = First(related_features) if(related_feature == null) { return null } return related_feature.current_plant_source
I am not sure you will get null at all. What I do is use count like this.
var related_features = FeatureSetByRelationshipName($feature, "Sept_Measure_Butternut_data_sheet", ["current_plant_source"], false)
if count(related_features) == 0 {
return "none found"
}
else {
return First(related_features).current_plant_source
}
Note syntax is not perfect but I hope you get the idea.