Hello! I have a feature class of survey points (SPOW_Survey_Locations) with two related tables (both are 1:many), one that contains survey route data (SPOW_Route_Data), and the other containing call point data (SPOW_Call_Point_Data). As a bit of context, there are route-level fields such as visit #, outing #, precipitation, temperature, moon phase, etc. that are completed at the start of a survey and represent the entire route. Then there are call points along a route where data being collected includes start time, end time, a bearing if a response is elicited, etc.. The data are being collected in Field Maps and having the two related tables allows route- and call point-level questions to be asked separately without using conditional visibility. The end user will want to see a table with individual call point data along with the associated route data, so I’m hoping I can auto populate the route fields in the call point related table from the route related table. I’m familiar with attributes rule that auto populate a shared field in a related table from a parent feature class (e.g., FeatureSetByRelationshipName), but I’m wondering how I would go about populating multiple shared fields in one related table from another related table, where the field I am interested in populating is not a field in the parent feature class, but a shared field among related tables. Thank you!
I'm not at all sure I understand your data structure...
Here's what I imagine from your description:
You explained Route_Data and Call_Point_Data. These seem like what you're interested in. What's the deal with Survey_Locations? Are they the actual survey results at a call point? Are the call points fixed for multiple survey on the same route?
An extract of your actual data would be helpful, either here or in a pm.
Assuming you want to implement the Attribute Rule on Survey_Locations:
// Calculation Attribute Rule on Survey_Locations
// field: empty
// triggers: Insert
// exclude from application evaluation
// get the related route
var route = First(FeaturesetByRelationshipName($feature, "SurveyLocations_Routes"))
if(route == null) { return }
// get the related call points
var call_points = FeaturesetByRelationshipName($feature, "SurveyLocations_CallPoints")
// create and fill an array that contains the updates to be made to Call_Points
var updates = []
for(var c in call_points) {
var update = {
globalID: c.GlobalID, // alternatively: objectID: c.OBJECTID
attributes: {
RouteAttribute1: route.RouteAttribute1,
RouteAttribute2: route.RouteAttribute2,
}
Push(updates, update)
}
// return the edit instruction
return {
edit: [{
className: "SPOW_Call_point_Data",
updates: updates
}]
}