Updating Feature Layer Attribute with Related Record Attribute Possible in ArcGIS Online Map Viewer and Forms?

603
4
Jump to solution
01-25-2024 09:38 AM
GISUSER6
New Contributor III

I have a feature service in ArcGIS Online with a polygon parcel layer and an inspection table. The parcel is the parent layer and it is related to a water service inspection. The end goal I am looking to have is that once an in inspection form is completed, it updates a field (Status) in the parcel layer that I can use to symbolize whether the inspection is complete for that parcel. 

I have seem varying posts about whether this is possible or not in ArcGIS Online Map Viewer. It seems like a simple task but I haven't been able to get it to work using Arcade in Web Map Viewer Forms

 

In the Forms, I have calculated the below expression for the "status" field in the Parcel layer I want updated. "InspectionStatus" is the field in the inspection form that field workers update and that I want recorded in the parcel layer : 
 
var relate = FeatureSetByRelationshipName($feature, "PrivateWaterServiceInventory" );
var inspection = First(relate);

if(inspection.InspectionStatus != null){
  return inspection.InspectionStatus;
} else {
  return null;
}
 
I am able to get the above script to work, but not automatically. I have to go into the parcel layer in Field Maps and click "edit" to start the arcade expression and fill in the status field.
 
Any help would be appreciated! Thanks.
0 Kudos
1 Solution

Accepted Solutions
marksm_macomb
Occasional Contributor

This is not possible using arcade in smart forms since the trigger for the action (submitting an inspection record) is in a different layer than where the actual calculation needs to happen (the parcel layer).

This is possible by setting up a scheduled python Notebook that would update your parcel layer every so often with the most recent inspection record. Some other people have posted similar questions and there are several posts that can give you a starting point:

Re: How to update a feature layer from related tab... - Esri Community

Easy How-To: Symbology Using Related Records - Esri Community

Easy How-To: Symbology Using Related Records - Esri Community

View solution in original post

4 Replies
marksm_macomb
Occasional Contributor

This is not possible using arcade in smart forms since the trigger for the action (submitting an inspection record) is in a different layer than where the actual calculation needs to happen (the parcel layer).

This is possible by setting up a scheduled python Notebook that would update your parcel layer every so often with the most recent inspection record. Some other people have posted similar questions and there are several posts that can give you a starting point:

Re: How to update a feature layer from related tab... - Esri Community

Easy How-To: Symbology Using Related Records - Esri Community

Easy How-To: Symbology Using Related Records - Esri Community

EmilyGeo
Esri Contributor

Hi @GISUSER6

Yep, it is true that editing the feature triggers the calculated expression.

Are the inspection forms being completed in Map Viewer?

0 Kudos
GISUSER6
New Contributor III

Hi @EmilyGeo ,

 

The inspections are mostly completed using Esri Field Maps but I have also set up the web app builder to edit/add inspections on a desktop if needed.

This seems like a super simple functionality that should be made available. Any idea if this is on the horizon for AGOL and Arcade? Glad to hear there is some sort of a workaround with Python but it seems like a lot of additional work for this request.

0 Kudos
EmilyGeo
Esri Contributor

it sounds like a good one for the ArcGIS Ideas board 😊

0 Kudos