Select to view content in your preferred language

Failed to calculate error

859
5
02-13-2024 04:48 PM
NLCCouncil
Emerging Contributor

Hi All i am using caculated espressions to auto pull user details into seperate holding fields different from the system last edited fields. 

Whenever i work in offline mode I and try to create a new feature I get "Failed to calculate" on that field in field maps ad can't save a record.   FYI its pulling GetUser($layer).fullName   pulling the username works offline.   so to try to solve it I added a small bit to try to return hard coded text or NULL if it can't calculate but I still get can't calculate error. 

I've tried it like this: 

var fullname = GetUser($layer).fullName

if (IsEmpty(fullname)) {
     return "Empty"
 } else {
     return fullname
 }  
 
 
 
5 Replies
KenBuja
MVP Esteemed Contributor

Does this null check work instead?

if (IsEmpty(GetUser($layer))) return "Empty";
return GetUser($layer).fullName;
0 Kudos
NLCCouncil
Emerging Contributor

Same as my testing it works when online but as soon as am in offline mode even your script still fails with 'failed to calculate' see attached screenshot

 

0 Kudos
DougBrowning
MVP Esteemed Contributor

Fullname does not work offline yet if I remember right - it was talked about at UC.  See this post.  https://community.esri.com/t5/arcgis-field-maps-questions/getuser-when-offline-and-disconnected/td-p... 

0 Kudos
NLCCouncil
Emerging Contributor

Thanks 🙂  i realized it's an issue with offline mode however shouldn't I still be able to use an arcade expression to tell it if I can't calculate then return null or another set string of text.  ??

0 Kudos
DougBrowning
MVP Esteemed Contributor

Use Console() to see what GetUser($layer).fullName is returning.  It may not be empty it may be an error string or something. 

0 Kudos