ArcGIS Pro 3.1
I want to auto populate from feature layer field "TDA_ID" to related table "assesment" with the same field "TDA_ID" and "repair_report" and also with the same field "TDA_ID".
I use this expression but did not work.
var originFeatureSet = FeatureSetByName($datastore, "TrafficDamageAssessment", ["TDA_ID"], true);
// Check if the current feature's TDA_ID is valid
if (IsEmpty($feature.TDA_ID)) {
return null;
}
var whereClause = "TDA_ID = '" + $feature.TDA_ID + "'"; // Assuming TDA_ID is a string. If it's numeric, remove the single quotes.
var relatedFeature = First(Filter(originFeatureSet, whereClause));
if (!IsEmpty(relatedFeature)) {
return relatedFeature.TDA_ID;
}
return null;