Return list from attributes using Arcade in Attribute Rule in Pro

696
0
05-28-2021 09:52 AM
Labels (2)
HungGiang
New Contributor

I'm having issue (not knowing proper Arcade scripting - still learning) trying to return a list of values from a table I am reading in for one of the Attribute Rules. I've done some searching and came up with the expression below. Maybe I'm going at it all wrong. Still learning Arcade.

The table is in the same file geodatabase as my feature class where the AttributeRule is being used.

The table (PROPCODE) has two fields (ParcelID, AssessCode):

PROPCODE

ParcelIDAssessCode
100301
100405
100305
200301
300375
300385
400301

 

I am trying to do a Calculation with Attribute Rule where if the user digitizes on ParcelID 100, the AR would kick in and read the above table and return 301,305,405. My issue is that it's only returning 301,

Here is the code I am using:

var ExtTable = FeatureSetByName($datastore, 'PROPCODE',['ParcelID','AssessCode'],false);

for (var Parcel in ExtTable) {
if ($feature.CITY_PIN == Parcel.PIN) {   //$feature.CITY_PIN is the current record. in the example it is 100.
var ListIt = Concatenate(Parcel.AssessCode, ',');
return ListIt;
}
}
return '000'; //test just check if it returns anything

Any help would be appreciated. Let me know if additional info would help. Thanks!

Running ArcGIS Pro 2.6.3.

0 Kudos
0 Replies