Has anyone had success calculating the username when offline? Documentation says I should be able to use the layer. Works testing but does not work in app.
var u = getUser($layer);
var fullName = u.fullName;
return fullName;
I'm using GetUser(FeatureSetByName($map,"NameOfLayerInForm")).fullname and it's not working even when I download a map for offline use (i.e. still connected to the internet, but offline map downloaded).
This scenario should be fixed with our release scheduled for next week.
For the second scenario, when the device is offline, the expression will fail. This is still under investigation and won't make this release.
Thanks @Anonymous User.
Can you confirm whether any other Arcade expressions will work/fail when the device is fully offline? Or is GetUser a special case?
As far as I know, Portal() and GetUser() are the only functions that do not work offline now. We fixed several issues with feature sets and relationships with the 22.3 release so those should work offline now in all cases.
Hi! @Anonymous User ,
Any updates on the GetUser() working offline in Field Maps?
Thanks,
Kathy
Has this fix been pushed to Enterprise 11?
@Anonymous User do you know if there are plans to add this functionality in? As of now the GetUser() is still not working in offline mode.
Just wanted to mention that we were using this on a hidden field, so when the user hits the Submit button, they receive an error message:
Unable to Submit.
1 Hidden Attribute Failed.
@Anonymous User you seem to be the person with the answers! Any update on this?
I came up with a way to generate a unique ID for a feature with Arcade in Field Maps, but it utilizes GetUser()... Really a bummer that this doesn't work in a disconnected environment. Here's the post on creating that unique ID if anybody can benefit: https://community.esri.com/t5/arcgis-collector-questions/field-maps-arcade-expression-calculation-only/td-p/1271471
Hi @BrantCarman
We have been using GetUser() offline for the last month and it is grabbing usernames in Field Maps successfully 🙂 Below populates the sampler name field based on username.
var user = GetUser(FeatureSetByName($map, 'Herring Samples:')).username
var sampler = Split(user,'.')
var user1 = Proper(sampler[0])
var user2 = Split(sampler[1],'_')
var fid = Text(user1 + " " + Proper(user2[0]))
return fid
Interesting! @kmsmikrud can you confirm this works when fully disconnected? ie., turn off wifi and cell data on the device. Your Arcade code looks similar to mine, except that I'm pulling fullName rather than username, and it will work for me in a downloaded offline map only when my device has an internet connection.