Select to view content in your preferred language

Handling calculated fields that don't work offline

248
8
07-28-2025 07:58 AM
GLCAdmin
Occasional Contributor

Last year we set up a Field Maps form with some optional calculated fields that fail to calculate if the user is offline. For example: this expression to capture the email associated with the user's account doesn't work if someone is working offline:

return GetUser(Portal('https://arcgis.com')).email

The required box was unchecked for those fields, and offline users could submit the form without a problem. Now the form fails to submit even though the fields are ostensibly not required. Did something change? Is there any workaround for this kind of field? Since Arcade doesn't have try/except, I don't know of a way to test whether online-only functions will work without returning an error. Maybe we just need 'online' and 'offline' versions of the same map with different forms?

0 Kudos
8 Replies
ChrisDunn1
Esri Contributor

Hi @GLCAdmin ,

There will be some improvements with the GetUser() function in an upcoming release of Field Maps, but in the meantime if you use GetUser($layer).email, that should work both online and offline.

I hope that helps!

Chris

0 Kudos
GLCAdmin
Occasional Contributor

Hi @ChrisDunn1 - 

Good to hear about the upcoming improvements. It looks like the field still fails to calculate using GetUser($layer).email as the expression when using Field Maps offline.

0 Kudos
ChrisDunn1
Esri Contributor

Hi @GLCAdmin - I may have been mistaken. I think that the only parameter from the user dictionary that is taken offline is the username, so you may need to record the username and then do some post-processing to match the usernames with e-mail addresses.

It may also be worth testing in the current Field Maps public beta as any improvements to the GetUser() function will be available there.

Chris

0 Kudos
AaronPDXPaul
Frequent Contributor

I believe getting User Email is used as one example of the Form failing to Submit.

Solving how to get it to Submit for Email only doesn't solve the main issue.

Non Required, Calculated Fields are now Required to Submit a Form.

If the Field doesn't calculate. Even though the field is not required, the Form does not Submit.

Something changed in AGOL. Because it used to Submit. Even if a record wasn't calculated.

Can you replicate this issue, and is it being resolved?

Thank you,

Aaron

0 Kudos
KevinBurke
Esri Contributor

Hi @AaronPDXPaul 

Just for clarification, you're working with a form that has calculated expressions that, despite not being calculated, cause the submit to fail. Is that correct?

Are you seeing `Failed to calculate` errors on the fields?

Can you please share more details about the behavior you're running into? 

Thank you

-Kevin

 

 

0 Kudos
AaronPDXPaul
Frequent Contributor

Hi Kevin,

You summarized the issue pecisely.

The Form has not required, calculated fields, using FeatureSetByName on a PUBLIC REST service.

The Form does not Submit if the expression fails to calculate, like if the service is not accessible, or no internet.

var fsShapeFields = FeatureSetByName($map, "Water Table", [], false);

var testVal = Intersects($feature, fsShapeFields);
var value = "OUT";

for (var testfeature in testVal) {
    value = "IN";
    break; // Stop at the first intersection
}

return value;

 

0 Kudos
KevinBurke
Esri Contributor

Thank you @AaronPDXPaul for the info. 

Would you be able to share the map with me so I can test it out? Assuming this is through AGOL?

-Kevin

0 Kudos
AaronPDXPaul
Frequent Contributor

I'm experiencing a similar, if not the same, issue.

Calculated fields, that are not required, prevent users from Submitting a record.

I believe that's the same issue in this post, and we are having it as well.

Is this expected?

0 Kudos