Let us mark a calculated expression as global, and make those global expressions available in any layer within the same map.
The problem:
Often when I'm configuring a new app for data collection, there are a number of tracking fields that exist in the schema across all layers in the map - things like Operator, Inspection Date, etc. These fields typically use calculated expressions to auto-fill. But right now, I'm forced to recreate the same expressions over and over for every layer and every field.
In a recent app, I had 20 layers, each using the same 5 expressions in their forms. That is 100 times I had to create the same expressions, instead of simply doing it 5 times. Yes, this can be done in json, but that's not an accessible option for all.
What I’m suggesting:
A few extra thoughts:
If a global expression is being used by multiple layers and then gets turned off (unmarked as global), a copy of that expression could automatically be saved into each layer that was using it.
Or, the system could prompt the user with a message like:
“This expression is currently shared with other layers. Would you like to copy it into those layers, or remove it from all?”
To avoid name conflicts between global and layer-specific expressions, a special prefix could be used for global ones. For example, instead of 'expr/agol-user', it could become 'exprglb/agol-user' or something similar. This would help keep things organized and clear in the config.
This same concept could be extended to the form expressions for Editable, Required, and Visible, showing only the relevant global expressions for each one. Likewise, this would be super helpful for Pop-up Attribute Expressions to share common pop-up configurations across all layers.
How this is different from saved expressions ideas:
I’ve seen other ideas suggesting that expressions be saved and shared across the entire organization. I think that would be awesome too—I’ve definitely upvoted those. But I get that something like that would be a much bigger lift. It would probably require a whole new item type, support for sharing and importing across different apps and editors, and dealing with compatibility between schemas, types, and platforms.
What I’m proposing here feels like a simpler solution for this specific use case. Just store the global expressions inside the map itself, and duplicate them in the JSON wherever they’re used. No need to overcomplicate it.
This seems like a realistic middle-ground between the current manual duplication process and the more complex org-wide expression sharing ideas that have been suggested. Since Esri already supports shared expressions within a single layer, this could build on that pattern at the map level without needing entirely new content types or platform-wide changes.
Absolutely, yes please.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.