Select to view content in your preferred language

Run Calculate Field or a TRIGGER when performing an INSERT, UPDATE or DELETE on hosted feature services

574
1
06-08-2023 05:53 PM
Status: Open
alex_mapintel
New Contributor III

The idea would be to add TRIGGER like functionality to hosted feature services. The trigger would initiate Arcade expressions or SQL or other defined logic when an UPDATE, INSERT or DELETE occurs on a record. It should be dynamic i.e. something that happens automatically and also works offline.

This idea would enable:

- The ability to update parent table attributes when an INSERT, UPDATE or DELETE occurs on a related tables.

- The ability to add or update feature layer records when an INSERT, UPDATE or DELETE occurs on another feature layer.

- The ability to define logic. For example, add related records when certain logic is satisfied on a parent table i.e. when a value in a parent table attributes reaches a certain value then add a new related record.

- Enables the following scenario to avoid post processing: Say I have a feature service named "trees" (hosted feature service in AGOL). Within it I have a feature layer (point) called "tree_assets" and a related table called "inspections". Each time an inspection is created or edited, I want to update the tree_assets feature layer attribute "latestInspection" with the edit date of the latest inspection record. This way, I can symbolise the parent layer (tree_assets) to have green dots (inspected in the last week) and red dots (inspected prior to 1 week ago) on the map.

I guess this is both an ArcGIS Online and a Field Maps Idea but I couldn't figure out how to tag it to both.

1 Comment
alex_mapintel

FYI, there is a discussion and some workarounds regarding this topic in the community questions:

Update Parent Table when Related Record is Created