Select to view content in your preferred language

Intersect Arcade Expression Test execution error

170
0
02-26-2025 08:40 AM
Labels (1)
LindseyStone
Frequent Contributor

I have an Intersect Arcade Expression that I'm adding to a layer with a bunch of small polygons to intersect a march larger polygon.  I'm doing this across two different layers within two different services published as Map services to my portal.  One layer is working and one is not.

The below is NOT working.  When I run this I get "Test execution error: Unknown Error. Verify test data." when I run it.  I found if I delete the First in the Intersect clause then I get "Test execution error: Execution error - Cannot access value using a key of this type. Verify test data."  In both the working and not working layer, they are polygons and the fields that I am displaying are Integer Fields.

var cra_fields = [
  'CRA_AREA'
]

var craa = FeatureSetByPortalItem(Portal('https://######/'), 'ae5d1369bf0942eda25e42aaac316677', 4)
var incra = First(Intersects($feature, craa))

If(IsEmpty(incra)){
  return 'Not within CRA Area'
} else {
  return `CRA Area: ${incra['CRA_AREA']}`
}

   This one is working and is exactly the same code, only a different layer.

var anx_fields = [
  'AnnexDate',
  'AnnexYear',
]
var annex = FeatureSetByPortalItem(Portal('https://####/'), 'a2ef88e45eb34494859820e5295b2b98', 10)
var inanx = First(Intersects($feature, annex))

If(IsEmpty(inanx)){
  return 'No Annexation Data'
} else {
  return `Annexation Year: ${inanx['AnnexYear']}`
}

   

0 Kudos
0 Replies