Issue on Getting Count of Intersect in Arccade Attribute Rule

398
5
04-03-2023 03:43 PM
MarcoMob
New Contributor II

Having  two feature classes in SDE geodatabase like

-  EGDB.North.Parcels

-  EGDB.North.ProjectsInvest

I am trying to get the total count of Intersection between  EGDB.North.Projects in EGDB.North.ProjectsInvest using Attribute rules like this

 var intersects = Intersects(FeatureSetByName($datastore, "EGDB.North.Parcels"), Geometry($feature)); return Count(intersects) ; 

 

but I am getting this error

002717: Invalid Arcade expression

 

var intersects = Intersects(FeatureSetByName($datastore, "EGDB.North.Parcels"), Geometry($feature));
if(Count(intersects)>0){
  return Count(intersects);
}
else{
  return 0;
} 

 

 

 

Tags (1)
0 Kudos
5 Replies
TedHoward2
Esri Contributor

Using reserved function names as the name of a variable is a bad idea. Try using "var inter =" instead.

Also, you do not need to use fully qualified names for FeatureSetByName. Just use "Parcels".

0 Kudos
MarcoMob
New Contributor II

Thanks for reply Ted but nothing changed!

 

var inters = Intersects(FeatureSetByName($datastore, "Parcels"), Geometry($feature)); 
return Count(inters) ;

 

still getting same error message

 

0 Kudos
TedHoward2
Esri Contributor

That looks valid.

You could try exporting those features classes to FGDB or MGDB to see if the problem is specific to SDE.

0 Kudos
MarcoMob
New Contributor II

Well, this is weird

As you recommended I copied both

-  EGDB.North.Parcels

-  EGDB.North.ProjectsInvest

into a local FGDB and this is working now

 

var inters = Intersects(FeatureSetByName($datastore, "Parcels"), Geometry($feature)); 
return Count(inters) 

 

 

So, why this is happening in SDE? how can I fix this? Is there any solution for this? Thanks

0 Kudos
TedHoward2
Esri Contributor

I believe this is the same issue found here

https://community.esri.com/t5/attribute-rules-questions/attribute-rule-not-working-anymore-in-3-1/td...

I recommend contacting Tech support for a way forward

0 Kudos