I think it would be really cool if the arcade expressions you write in the web app, like in form builder, actually worked in Field Maps as well. What a common and frustrating experience, you spend a bunch of time building expressions and test them in the web map, to only find out that THEY WON'T WORK IN FIELD MAPS.
Like what a waste of time and energy.
Field Maps Designer does a bit of a better job blocking things that will not work in Field Maps vs the web form builder. It is what you should use to build forms. Give that a try. Its not perfect still but better.
Hi @DarrylAlbert ,
I'm sorry you're running into some frustrating issues with arcade. Can you share some more details about what is not working? Are the arcade expressions returning errors in Field Maps or the wrong value/null results? If you can share some of the expressions that aren't working and how you're using them (forms, popups, attribute rules, etc) we may have some insight to help things get unstuck for you.
Chris
Looks like OP never responded but I have some examples where the expressions work in the web map on ArcGIS Online, as well as Field Maps Designer. When I try to test them in the Field Maps app, I get the error "failed to calculate".
Here are a few examples that aren't working for me:
if (IsEmpty($originalFeature.OwnedBy)) {
return "County"
} else {
return $originalFeature.OwnedBy
}
var userInfo = getUser();
var name = userInfo.fullName;
return name
For the second expression, try getUser($layer), that should work in Field Maps.
For the first expression, I'm not sure why it wouldn't work - what is returned in the error? If you tap on the error in the form it should give you the option to share it, but you can also look in the troubleshooting log, that may provide a bit more information. Does it fail both when the OwnedBy field is empty and when it already has a value?
@ChrisDunn1 I'll have to try getUser($layer) out. Thats one I have a whole separate piece of code for that returns either 1, 2 or 3 names from a username because getUser() doesn't work (though trying to remember if there was something related to Offline maps in there as well).
There are some limitations to using GetUser in an offline area in a disconnected environment, only a few of the user parameters are taken offline rather than the full dictionary that is accessible when online. The username should be one that's available both online and offline though, if that helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.