"Failed to Calculate" error on GetUser

1288
7
Jump to solution
04-03-2023 05:23 AM
BrianBulla
Occasional Contributor III

Hi,

So I'm trying to populate a field using an expression.  Just to fill it in with the logged in username, so a fairly basic one line expression, which compiles and works fine in the Arcade Editor on the AGOL Field Maps Early Access designer.

 

GetUser($layer).username;

 

BrianBulla_0-1680524686539.png

 

For some reason when running the app (using iOS), I get the "Failed to Calculate" error on that expression and it won't let me save the record.

Any ideas??

0 Kudos
1 Solution

Accepted Solutions
BrianBulla
Occasional Contributor III

But for some reason this does work.....so strange that this (and my first one) work in the Arcade Editor, but only one of them works in the actual app.

 

GetUser(FeatureSetByName($datastore, 'Manhole Inspections')).username;

 

 
"Manhole Inspections" is the name of the table where the attribute being edited exists.

View solution in original post

7 Replies
nspittlemeister_LCFPD
Occasional Contributor

Hi Brian,

This is what works for me: 

GetUser(FeatureSetByName($map, 'your map name')).username
 
Nick
BrianBulla
Occasional Contributor III

No, that doesn't work for me at all.  

0 Kudos
BrianBulla
Occasional Contributor III

But for some reason this does work.....so strange that this (and my first one) work in the Arcade Editor, but only one of them works in the actual app.

 

GetUser(FeatureSetByName($datastore, 'Manhole Inspections')).username;

 

 
"Manhole Inspections" is the name of the table where the attribute being edited exists.
RoanokeDave
New Contributor II
Similar, but I used the fullname parameter. If you are using SAML it will get the e-mail address plus your domain name with the username parameter.
GetUser(FeatureSetByName($datastore, 'Sanitary_Manholes')).fullname
0 Kudos
AllisonKampbell
New Contributor III

Thank you Brian, this was very helpful.  I modified your expression a little bit to use on a related table .  This worked for my snowplowing record:

GetUser(FeatureSetById($datastore, "3")).fullName;

KPyne
by
Occasional Contributor

I believe this bug is back...or at least I am unable to get the $layer, $datastore, or $map methods working again on iOS Field Maps

I should clarify I am online (not an offline workflow) and it is still failing to populate

ColinLawrence
Esri Regular Contributor

Looking into why this is happening. Seems to be related to the expression being 1 line only as something like this works:

var userInfo = GetUser(portal("https://www.arcgis.com"),"")
return userInfo.fullName

Regards,
Colin