Does this function run in app code or is this in the geodatabase? I am wondering if I can add the function to the Feature Template so it works if I add the feature service to a web map used by a collector app as well.
Is this pulling the ArcGIS Online account user?