I have seen a few discussions about GetUser() not working when using Field Maps in a disconnected environment:
Some discussion above was a bit muddled because not everyone was tested in a disconnected environment. Ultimately, no solution worked while offline.
The two above links seem to suggest that this is in fact, a bug that may be addressed down the road.
Has anyone come up with a way to get the current user's information in Field Maps when offline? Or do we have to wait until a bug fix/enhancement is released?
The only workaround I could think of was to use editor tracking fields, but these fields are not populated until after a data point is collected. So form calculations needing this information will not have it unless the user re-edits the newly added point. This is not a great solution.
When we use Field Maps, many users like to create IDs in their data that includes their initials. This should be easily automated.
I have done some more research into this and believe I have found a more viable solution.
What specifically does not work when offline is:
Using firstName or lastName also does not work. When I checked the Field Maps mobile app error log, the actual error for the Arcade expression is "field_not_found."
So clearly, a user's full name is not part of the dictionary returned by GetUser. So instead, I tried the following:
I figured, the editor tracking fields clearly have access to usernames, so maybe GetUser() does too. This DOES work while offline. When I say offline I mean my device is in airplane mode and I am using either an offline area created on the device, or an offline area created in Field Maps Designer. I tested both.
In my specific case, our organization uses first initial and last name as part of their usernames, so I can still get the information I want. I won't mark this as a solution though, as it is not quite as good as retrieving a full name. I also find it frustrating that this is not documented anywhere in the Field Maps references or the Arcade reference.