Select to view content in your preferred language

Tickle a web map so form calculations fire?

426
2
09-18-2023 01:39 PM
SFM_TravisBott
Occasional Contributor III

I'm looking for ideas on how to 'tickle' a web map so the form calculations will fire. The kinds of calculations I have in mind include things like querying another layer in the map and importing data from a field in that layer when a new feature is created.

Currently (as far as I know) there's no way to enforce attribute rules on a feature service. Calculations can be configured in a form, which are stored in a web map. But if, say, the feature service was to be accessed in Pro and in a web map, only the features made in the web map would have their attributes calculated as desired. If a feature is created in Pro, the field won't be calculated. But if that feature is opened in the web map for editing the calculations happen.

Calculations could be made entirely in Python after the fact, but I am wondering if there's a technique to nudge the webmap to execute the calculations it already has stored. 

0 Kudos
2 Replies
EarlMedina
Esri Regular Contributor

Is your requirement that calculations only fire when features are added via web or are you saying you want calculations to happen with all clients? I think if you don't care where the edits are being made the path of least resistance is to schedule a script to run every minute (or few minutes) between collection hours. You could set up the logic such that it doesn't recalculate everything, just what has actually changed.

I have experience doing this in the past with great success. Field crews and management had up-to-date information when needed (only had to refresh map).

0 Kudos
SFM_TravisBott
Occasional Contributor III

@EarlMedinaI'm saying the latter: that the calculations happen for all clients. What I like about keeping the map form-based calculations is that data editors get immediate feedback - they draw/drop a feature, and the second they start filling out attribute information they get to see a lot of information that's helpful for the attribution that they're responsible for. You lose that when you have a scripted solution. 

Since ~85% of the users for this service will access it through a web application I would like to keep the form calculations and use either a script or webhook solution to catch up with those submitted through Pro. What I was curious about was if there was a scripting solution that, rather than acting on the features in the feature service, could access whatever the hidden triggers are in the map that cause the already-written calculations to fire. 

Secondarily, since I have you here, it would be very helpful if either a) attribute rules could be enabled on feature services so that, when accessed in Pro, they still operate or b) if they can't live with the feature service then perhaps the forms that live in the map could carry into Pro, so the map could be opened there and the editing and QA experiences could be consistent across clients. The magic of feature services is how portable they are...they fact that they don't port across consistently is a short-sighted.  

0 Kudos