I have two related standalone tables for Utility Network (v7) power pole and underground asset inspection forms in Field Maps. What I'm trying to accomplish is change the symbology and labelling for a pole (in StructureJunction data) when an inspection form is submitted on the related table for that asset ID. With my Arcade expression, the rule works like a charm in Pro on a local copy of the UN data and tables. After publishing to the Portal (11.3), the attribute rule doesn't work. AI is telling me that cross-feature editing might not be possible in Field Maps. Anyone doing anything similar? I've had crews on multiple different projects ask for this sort of symbology change in the map so they know what they've inspected, what needs servicing, etc. It seems like this should be possible?? Here is my Arcade script
// Assign to inspectdate field
var inspectionAssetID = $feature.assetid;
var inspectDate = $feature.inspectdate;
if (IsEmpty(inspectDate)) {
inspectDate = Now();
}
if (IsEmpty(inspectionAssetID)) {
return inspectDate;
}
var structureFS = FeatureSetByName($datastore, "StructureJunctionsCopy", ["assetid", "globalid"]);
var matchingStructure = First(Filter(structureFS, "assetid = @inspectionAssetID"));
if (matchingStructure == null) {
return inspectDate;
}
var hasNeedsCorrection = false;
var hasCorrected = false;
var fields = [
$feature.polemissing, $feature.poleonmap, $feature.poleground,
$feature.groundrod, $feature.riserground, $feature.spacing,
$feature.ugriser, $feature.guysanchors, $feature.guyguards,
$feature.treesecondary, $feature.treeprimary, $feature.climbspace,
$feature.polecondition, $feature.armcondition, $feature.infrared,
$feature.switchcondition, $feature.drilltest, $feature.other,
$feature.powercommpole, $feature.powercommmid, $feature.powercommpoa,
$feature.powerroof, $feature.powerroad, $feature.powerdriveway,
$feature.powernearwind
];
for (var i in fields) {
var val = fields[i];
if (!IsEmpty(val)) {
// Convert to number to handle any type issues
var numVal = Number(val);
if (numVal == 1) {
hasNeedsCorrection = true;
}
else if (numVal == 2) {
hasCorrected = true;
}
}
}
var surveyedStatus;
if (hasNeedsCorrection) {
surveyedStatus = 2;
}
else if (hasCorrected) {
surveyedStatus = 3;
}
else {
surveyedStatus = 1;
}
return {
'result': inspectDate,
'edit': [{
'className': 'StructureJunctionsCopy',
'updates': [{
'globalid': matchingStructure.globalid,
'attributes': {
'surveyed': surveyedStatus,
'inspectiondate': inspectDate
}
}]
}]
};
Solved! Go to Solution.
Actually I just discovered the problem. I needed to change the references from StructureJunctionsCopy to StructureJunction in the script. Now it works!