Add the ability to create User-Defined functions at the map level that can be called by any expression like Arcade's built-in functions. This will dramatically cleanup a lot of reused code from one field or layer to the next. Write it once, call it when it is needed.
What might be needed to make this happen.
- A place in Field Maps to author these functions.
- A new section in the maps definition (JSON)... e.g. userDefinedFunctionInfos[]
- Define function properties:
- function name
- function expression
- function description (shown in the blue information symbol, so a user knows what the function does and what parameters it takes)
- A new tab in the Arcade Editor "User-Defined Functions".
- Validating that the name of the function does not conflict with the name of a built-in function or prefixing the name of the function with text that ensures it can never conflict with a built in function.