Select to view content in your preferred language

ArcGIS Field Maps and Attribute Rules for Related Tables

1000
5
08-29-2024 01:10 PM
KevinPiraino2
Frequent Contributor

I currently have published (non-hosted) feature service that connects to my enterprise geodatabase that is used to manage tree inventory data published using ArcGIS Server 10.9.1 and the feature service being added to ArcGIS Online. This feature service has three layers: 1 point feature class, 1 non-spatial related table, and 1 attachments table. The related table is a 1 to many relationship where 1 point (tree) can have many records (tree maintenance records).

I have instituted an attribute rule where the latest (or last added) maintenance record's "condition" field is used to attribute a "condition" field in the parent point feature class.  This attribute rule works fine in ArcGIS Pro and the results from the attribute rule can be seen nearly automatically. The issue I am running into is when trying to test the workflow in ArcGIS Field Maps of adding a point --> adding maintenance record (or just adding a maintenance record to an existing point) and the maintenance record's attributes not being saved / sent / submitted on the first try. Only after the second attempt is the maintenance record's attributes being saved / sent / submitted and thus the attribute rule being executed. 

It's unclear to me if its an attribute rule issue, a feature service issue, a data issue, or just a general bug / issue with my version of Field Maps. 

0 Kudos
5 Replies
DougBrowning
MVP Esteemed Contributor

If I am following my guess is that Attribute rules run on the server side not the tablet.  So on first submit its blank since the rule has not run.  On second submit it appears since it is updating values after the server has run the rule.  That still seems weird to me but a guess.

I think what you may want instead is to use a calculated expression in a Field Maps form via the Field Maps Designer.  That way it will run on the tablet at form time.

Hope that makes sense and is the issue.

Me I tend to do any of these parent summaries in Arcade after the fact in the map.  They are not real fields though so plus and minus to that.

KevinPiraino2
Frequent Contributor

That is an interesting point and something I also thought about (re. rule runs server side so the result is a delay in the execution of the rule). I haven't been able to find anything in ESRI's documentation or other GeoNet posts for similar workflows (using a non-hosted Feature Service) that are having the same issues. 

I tried to formulate the attribute rule in the Form designer and the Field Maps designer, but in both cases I was unable to create an arcade expression to work correctly. In all cases the arcade expression couldn't be executed (error) or would not execute at all and return no value.

After a bit more digging, I found an additional GeoNet post that was attempting to do what I was looking to implement. The post referenced the ESRI Github page with examples on different arcade expressions with one of them being exactly what I was trying to do (https://github.com/Esri/arcade-expressions/blob/master/attribute_rule_calculation/UpdateParentFeatur...). After doing some testing, this arcade expression found in the URL works perfectly and does not cause any issues or delays in posting data.

ShoNuff
Occasional Contributor

Hi Kevin. I just ran into the something similar. I have a Culverts feature class with a related condition inspection table stored in SQL Server. The attribute rule runs fine when adding an inspection in ArcGIS Pro and in a live Field Map, but when I do the same in an offline map in Field Maps one of the following occurs:

 

1. I get an error the first time I sync and I submit it a second time and it goes through.

2. I don't receive an error and it goes through fine.

 

It is not consistent. I tried to click on the link you provided but it says that the page is not found.

0 Kudos
KevinPiraino2
Frequent Contributor

My apologies, it appears ESRI updated their github page and moved the page I had linked. See this link (https://github.com/Esri/arcade-expressions/blob/master/attribute-rules/attribute_rule_calculation/Up...). 

Regarding offline editing, this is not something I thought about as I have yet to incorporate offline editing in any workflow I have been using. I would try expression that ESRI has provided and see if that may be resolves the issue. If not, then I guess it would be a technical services questions/ticket.

0 Kudos
ShoNuff
Occasional Contributor

Ah OK. For some reason I was assuming this was offline but I should have paid better attention. Thanks for the link! I will compare it to what I am doing currently. 

0 Kudos