Arcade expressions not working as expected or erroring

635
6
03-13-2023 05:47 AM
BarryKeight
New Contributor III

Hello, We have developed a Field Map with a couple of Forms included and within the form we have 7 Arcade expressions to auto fill the fields. They are all simple expressions, such as getting user details or intersects to other layers within the web map. We have had to disable most of them as they don't always calculate in the field. They work fine in the office on Wi-Fi and mobile data. What could be the possible issue?

example:

var regions = FeatureSetByName($map,"Regions Operational", ['Name'])

// Intersect the current location with the regions and get the first region
var region = First(Intersects($feature, regions))

// If the current location does intersect a feature, return the name of the region. Otherwise, return null
if (!IsEmpty(region)) {
    return region['Name']
} else {
    return null
}
0 Kudos
6 Replies
kmsmikrud
Occasional Contributor III

Hi,

I have similar expressions set up and we are just going to be starting offline surveys. When you say the expressions don't always calculate do they show consistently with the red message 'failed to calculate' in the layer form?

How are you downloading/creating the offline map areas? We did recently log a bug/defect in that the  offline map generated from the AGOL web map settings, when we opened the form 2 of the calculated expressions did not work. However when we download an offline map using the device to create the offline map these expressions DO work. So something is happening when the maps are packaged up.

Also we are using AGOL and iOS, what environment and device are you using?

We work 100% offline and this is the first go of using these expressions in all the layer forms, so I'm hoping they are reliable, but at the same time already logged a defect.

Thanks,

Kathy

0 Kudos
BarryKeight
New Contributor III

Hi Kathy, did you only experience issues offline?

0 Kudos
DougBrowning
MVP Esteemed Contributor

Yes this will work as long as you have both layers and the features needed in the map and part of the offline area.

0 Kudos
BarryKeight
New Contributor III

We have set this is up to work both on and off line and we have tried it on both iOS & Android and it had no issues under testing. When it was rolled out we had initial comments that not all the auto calculated fields (required fields) worked and therefore stopped the user being able to submit the form.

At present they are turned off and we are looking at having to post process. Which isn't really useful for saving time and resource.

0 Kudos
DougBrowning
MVP Esteemed Contributor

It is only some users then?  I wonder if their apps are out of date?

0 Kudos
BarryKeight
New Contributor III

We have two users trialling the new version and they have one of both mobile OS, both of which are up to date.

0 Kudos