Need ability for realtime python script to perform field calculations on multiple fields in a record when that record is new or updated.
Looking for equivalence to SQL triggers or form departure actions - Example - a feature field for a utility pole such as "Serial number" is added/updated in the field from a asset tag. This would trigger a script to fill in other fields for that record. Currently I do this with a nightly script. Realtime updates would allow the field worker to enter a tag number and submit the record, and view results to help confirm accurate entry of "Serial number". Field data entry (Collector with a touch screen in the sunlight) is prone to error. If the realtime "serial number" field calc returned a "material type" =Steel, and it was a wooden pole, it would let the field worker see that the "Serial number" was incorrectly entered. Using a prepopulated related table does not work, since entries may be deleted or keys nulled by edits of the feature class.
In terms of what group is best to share this in, I am struggling a bit. It is clear you are using Collector, so sharing it with Collector for ArcGIS would be good. Seeing the desired outcome/change is being driven by using Collector, maybe those folks can point you in the right direction.
You have posted it in ArcGIS API for Python, which could be a good place, but you haven't stated enough about the system configuration and workflow to know for sure. Even if you are thinking ArcPy, more information would still be helpful.
Browser and mobile clients have no capability in this regard. It would be simple to do with a sql trigger, but the esri model precludes this. Right now we have data from collector and browser and arcmap. Currently nightly python script disables services and edit tracking and compares and updates field in the feature class.
Nightly updates doesn't give users inputting data feedback. Am now looking at geoevent server as a way to have realtime field calcs to fill in the blanks.
> Need ability ... to perform field calculations on multiple fields in a record when that record is new or updated. ... Realtime updates would allow the field worker to enter a tag number and submit the record, and view results to help confirm accurate entry of "Serial number".
I suggest you take a look at Survey123 for ArcGIS. It is a form-based field collection app, and it enables you to execute calculations as data is entered into the form. It supports complex calculations as well - although, I am not quite sure what kind of calculations your python scripts perform.
It can also work in conjunction with Collector for ArcGIS.
Hope this helps,
Thanks for that suggestion. Our nightly script accesses a "dictionary" or "lookup table" in the form of a CSV, and uses the Serial number to lookup the values for 6 or 7 other fields. The Dictionary has about 120,000 entries, and is updated periodically from another database. The only thing that comes close in Survey123 is the pulldata function, which would use a CSV file in the Media folder on the device. I can't see a good way to keep the CSV dictionary on individual devices current. Part of this request is driven by the need to simplify field data entry - allowing an error check and providing information that is not available in the field. Part of it is guaranteeing consistent data entry for fields that are extensively used for queries. In direct database applications, there is a form driven entry with actions on change or field departure. Being able to trigger a python script on submitted data from browser or mobile clients is the closest approximation to this I can see.