Can we set a calculated field to only calculate when offline map is syncronised?

1349
6
Jump to solution
05-03-2022 11:24 PM
LindsayRaabe_FPCWA
Occasional Contributor III

I've just started using Calculated Expressions in fields in feature services used in offline maps in Field Maps. So far, it's been great, but I do have a question. 

Is it possible to set a field to trigger the calculation when the data is syncronised to prevent duplicate values being calculated?

In my particular instance, I'm calculating an incrementing ID that reads the existing features, finds the max value and adds 1 to create a new value. This works fine when in online mode, but when offline, it only reads the features that are also offline, and thus only increments upwards from there, resulting in duplicate values. If the calculation could be fired on sync, then it would (hopefully) read all values in the feature service first and calculate a new unique value. 

Lindsay Raabe
GIS Officer
Forest Products Commission WA
1 Solution

Accepted Solutions
by Anonymous User
Not applicable

This is not supported with Form Calculations. You need server-side logic to mange a consistent sequence. Form calculations are only evaluated on the client apps.

Attribute rules is a better option for this, though it's not supported in ArcGIS Online yet. Here's a video showing how this could work in Pro and eventually in other products.

View solution in original post

6 Replies
by Anonymous User
Not applicable

This is not supported with Form Calculations. You need server-side logic to mange a consistent sequence. Form calculations are only evaluated on the client apps.

Attribute rules is a better option for this, though it's not supported in ArcGIS Online yet. Here's a video showing how this could work in Pro and eventually in other products.

LindsayRaabe_FPCWA
Occasional Contributor III

Hi Aaron. I suspected that the answer might be around Attribute Rules, but also couldn't find anything about them working in ArcOnline yet, so thanks for clarifying that. 

Lindsay Raabe
GIS Officer
Forest Products Commission WA
0 Kudos
GuyWeerasingheAFF
New Contributor III

I think this has been addressed now

Works with offline maps, but not when you have the device in offline/airplane mode and using the AGOL webmap

Solved: Field Maps, Offline Map, Arcade Calculation Expres... - Esri Community

0 Kudos
JonSwoveland
Occasional Contributor

Hi Lindsay,

I found your post while looking for a similar solution to generate a unique human-readable record id for features created by an offline app.  In my case, the app is VertiGIS Studio Mobile, not Field Maps, but it uses the exact same gdb synch mechanism.  Similar to your case, I want to generate an id that is a combination of a "Task Type" key, followed by (Max Record + 1).  I'm curious if you got this working offline, and if so, does the field value get calculated only upon data synchronization? 

Cheers,

Jon

0 Kudos
LindsayRaabe_FPCWA
Occasional Contributor III

Hi Jon. No, I never really found a solution to the "Calc on sync" issue. My only thoughts on how to make it work would be to find a way to ensure that you calculate unique values when offline. Maybe by including a character per user (if you know that each user will only have 1 device), or instead of user per device ID plus maybe a date & location component. 

Lindsay Raabe
GIS Officer
Forest Products Commission WA
JonSwoveland
Occasional Contributor

Thanks for the quick response, Lindsay!