Select to view content in your preferred language

Calculated Expression to update Parent record from data from the child records. What actually triggers a calculated expression?

1038
1
06-29-2023 10:23 PM
gis_KIWI4
Occasional Contributor II

I have a dataset with a feature class (point layer) and inspections as related table in ArcGIS Online. I am trying to populate fields in the parent feature class when I add a record to the related table. I have a created a calculated expression in the FieldMaps Designer App

Example - The calculated expression is in the parent table and it is to count the number of related items.

 

var relatedrecords = FeatureSetByRelationshipName($feature, "Notice")
var info = Count(relatedrecords)
return info

 

 

 

 

When I add a new entry to the child table the calculated expression doesn't trigger and the value isn't updated. When I try to edit the parent record, the calculation kicks in and updates the value. 

Has anyone found a way around this? I understand that I can use this in the pop-ups and symbology but I have a requirement to write the calculated value to the parent feature layer.

Thanks 🙂

EDIT - I am also aware it works in the other direction when updating attributes in the child table based on the related parent table because you are already editing the child record and data you need is present in the related parent table. 


 

 

0 Kudos
1 Reply
ChristopherCounsell
MVP Regular Contributor

This is expected behaviour. There is no automated calculations.

https://support.esri.com/en-us/knowledge-base/faq-is-it-possible-to-automate-field-calculations-in-a...

If you run the calculation (e.g. by editing) it will work.

You can do this as part of the workflow using Survey123 Inbox (add record, edit parent).

Or you can set up an automated process such as FME, ArcGIS Notebook, Python. To run the calculations periodically.

0 Kudos