I came upon a weird issue yesterday. In one of our projects, we registered an Enterprise feature service to AGOL, and we use an Arcade field calculation to populate an "Inspector" attribute using GetUser($layer).username. As noted in previous threads, the .fullname property does not work offline, but the .username property does work offline.
However...we have found the following combination creates an unexpected result:
Everything works fine if there is any sort of connectivity. In other words, works fine with an offline map as long as you have a pulse on your cellular. Also works fine with hosted layers, of course.
I did find a workaround:
Surely this is a bug? Returning the login info of the app seems like a pretty basic function, not sure why it's tied to the data layer and not the app itself. Am I missing something? Is there a more elegant way to do this that doesn't involve adding a fake layer?
Known issue for a few years now. I guess its still not fixed.
Some workarounds in these posts
Thanks Doug. I've seen those posts. The main thing that makes my case unique is registering an Enterprise service with AGOL. So far I haven't seen any workarounds besides the one I just came up with.
In one case I overcame this by enabling editor tracking which will capture the logged in username.
Then, since it is registered Enterprise service, I have a trigger in the database that calculates the user info to the appropriate table/fields(s). Couldn't just use editor tracking as I needed the username updated in a related tracking table.
Have not tested in a completely offline/disconnected environment.
R_