Select to view content in your preferred language

Arcade Intersects function stopped working after the last update.

407
5
Jump to solution
07-03-2024 05:38 AM
Labels (2)
FranklinAlexander
Occasional Contributor III

I have a web map that contains a hosted feature service containing two layers, a point layer and a polygon layer. There is a relationship class that now shows up in the layer tables since the last Esri update. There are also Arcade expressions set up for several of the fields, but one expression in particular broke since the last update and I haven't been able to get it working again. I now get an error in the Output console: 'JSON object is already hydrated. Verify test data' and have narrowed the cause down to the Intersects function. To be clear, this code was running without error before the last update, so I have no idea what is causing it and how to fix it. Here is the code:

var custInfoLayer = FeatureSetByName($map, "Customer Information", ["CustomerID"], true)
Console("Customer Info layer feature count " + Text(Count(custInfoLayer)))
var intFeature = Intersects(custInfoLayer, $feature)

 

The custInfoLayer variable is valid, it returns 15 records from the Console function. The Customer Info layer is a point layer and the feature is associated with other map layer, a polygon layer. 

IntersectFeatures.PNG
 
 
 
 
 
 
 
 
I understand that hydrating an object has to do with loading it with data, but don't see why that error is relevant to simply selecting an intersecting feature. There must be something else going on that I am not seeing.
 
1 Solution

Accepted Solutions
JustinColville
Esri Contributor

Hello @FranklinAlexander 

Sorry for the inconvenience.  The team has identified an issue with testing certain geometry function in the Arcade editor in Field Maps Designer and in Map Viewer when authoring forms.  The issue appears to be limited just to when testing in the editor.  The expressions should still continue to work in Field Maps Mobile.

The team is working on a fix for the issue aiming to have it patched on Monday.

View solution in original post

5 Replies
jcarlson
MVP Esteemed Contributor

That is very strange. I've never seen that error myself, so I don't really know what would change it. A couple shots in the dark here:

One: replace FeatureSetByName with FeatureSetByPortalItem? But like you said, the featureset goes to the console just fine. Still, it wouldn't be the first time that using a different FeatureSet function changed things.

Two: nest the FeatureSetByName function inside of the Intersects function. In the past, this sort of thing didn't matter, but maybe the update changed how Arcade gets compiled and turned into an actual server request. Intersects($feature, FeatureSetByName(…))

- Josh Carlson
Kendall County GIS
0 Kudos
FranklinAlexander
Occasional Contributor III

Good suggestions, I tried both of them and got the same result. I may just try re-creating the map from scratch, something could have gotten corrupted during the update.

0 Kudos
TomMillerIPC
New Contributor II

I am getting the same error on a similar expression today in AGOL. I can confirm inside Field maps, that it gives a warning that my calculated expressions are failing to calculate, but when I click add point it populates the correct values from the intersect expression.

JustinColville
Esri Contributor

Hello @FranklinAlexander 

Sorry for the inconvenience.  The team has identified an issue with testing certain geometry function in the Arcade editor in Field Maps Designer and in Map Viewer when authoring forms.  The issue appears to be limited just to when testing in the editor.  The expressions should still continue to work in Field Maps Mobile.

The team is working on a fix for the issue aiming to have it patched on Monday.

FranklinAlexander
Occasional Contributor III

Thank you for the response, and everything works as expected now!!

0 Kudos