Hello all, I am attempting to transfer field data 'Grid' from multiple Centerline fc segments into a RoadName table that takes the values, disolves and sorts them.
The data is connected through a relationship class based on a foreign key in the Centerline fc and a primary key in the RoadName table.
I am able to pass the data through, with an Attribute Rule with the results that looks like:
T8,T8,T7,T8,T8,T8,T8
So when I attempt to pass it through an Array to use Distinct & Sort, it is unable to identify the above correctly and returns the following:
'T8', 'T8, T7', 'T8', 'T8', ....
Here is the code I am using.
// first read out the Foreign Key of the Destination Table (Feature Class)
var fcID = $feature.roadnameid
// access the Orgin table (Table)
var tbl = FeatureSetByName($datastore, 'dev_Cathedral.DBO.MasterRoadCenterline');
// create a sql expression to query on Primary Key
var sql = "F_roadnameid = '" + fcID + "'";
var related_data = Filter(tbl, sql);
// count the resulting records
var cnt = Count(related_data);
// initiate a variable to hold the result
var results = "";
// check if there are related records found for the current ID
if (cnt > 0) {
// loop through related records
for (var row in related_data) {
// read some data and create the line you want
var line = row.Grid;
// add the line to the result
results +=line;
}
} else {
results = "Need Table relate";
}
// return the result
return results
This is in ArcPro 2.8.1 using an attribute Rule connected & relationship class
Thank you for the help