Select to view content in your preferred language

Arcade expression: $map not recognised

459
4
Jump to solution
02-13-2025 01:14 PM
FrankHerbert
Occasional Contributor

I'm getting a new error message that has never happened before. Please help!

In January 2025, I published a QuickCapture project for offline use. The user carries out a brief survey, and the new point feature is intersected with a vector polygon layer from the project MMPK. The vector polygon layer is very simple - just five regions covering the country, and the name of the intersecting region is passed to the new point feature. Here is the expression:

var regions = FeatureSetByName($map, "Regions");

// Filter the features where 'Type' is 'Ops'
var filteredRegions = Filter(regions, "Type = 'Ops'");

// Find intersections with the filtered feature set
var GEOGRAB = Intersects($feature, filteredRegions);

if (Count(GEOGRAB) == 1) {
  return Text(First(GEOGRAB).Region);
} else {
  return "NA";
}
 
 
I was able to publish the project, and it still works to this day in the field. I am trying to replicate the process for a separate project and that's when I noticed I couldn't publish the expression. I receive this error message:
 
Test execution error: Compilation error - Line : 1, 31: Identifier not recognized. Verify test data.

So there's is something wrong with the $map identifier, but I'm not sure what it is.
It might be worth mentioning, to publish the expression last month, I needed to use a dummy web map that was a replica of the MMPK. This allowed me to publish the expression and subsequently swap out the web map for the MMPK. This is a know bug to ESRI hence why I used this workaround.
 
Perhaps ESRI have released an update that will not let me publish the expression... I'm not sure.
Any help/advice would be appreciated.
0 Kudos
1 Solution

Accepted Solutions
FrankHerbert
Occasional Contributor

FYI this has been solved. Case closed!

View solution in original post

0 Kudos
4 Replies
FrankHerbert
Occasional Contributor

FYI this has been solved. Case closed!

0 Kudos
JasonBennett
Regular Contributor

What happened? I'm having a similar issue.

0 Kudos
JasonBennett
Regular Contributor
FrankHerbert
Occasional Contributor

When you add the project basemap,  just make sure to save and then refresh the QC project. Otherwise, QC doesn't seem to realise there's a project basemap containing the layers you want to query. Once you have done this, it will recognise the $map function in the expression and stop throwing out error messages