Branched from: https://community.esri.com/thread/196867-get-related-objects-in-arcade
I have a pipeline fc with geometry(fittings are drawn to scale as a polygon) with diameter, and globalid fields.
And then a view(table) containing asset name, attribute value, and a GISid.
This is a one-to-many relationship (GISid = globalid) because a section of pipe could have multiple materials (inner, outer, encasement, coatings, etc.).
I want to show the related information in the pop-up of the pipeline.
ahmadabusaleh , yes there is, but not in a single expression in AGOL yet. You would need several expressions, one to return the text and the other to define the color, and use both in a custom HTML pop-up
Hi ahmadabusaleh ,
Here is an example that shows how to do this: https://community.esri.com/message/943005-re-change-font-color-based-on-if-statement?commentID=94300...
Thanks Xander Bakker, looks good.
for my case I want to stay away from using HTML pop-up and keep using the table pop-up view which looks like it does not support color manipulation.
Thanks a lot
Hey Xander,
I was wondering if you know how to bring the count back into the table instead of the polyline? Is there a way to reverse these as an attribute rule that applies as an instant calculation when a relate occurs?
For instance, I am attempting to set up a similar calculation with Centerlines (polyline) and a Master Roads (table), where the centerline derive their street name fields from the Master Road Name table, and then calculates the number of segments as a count.
There is globalID from the table, that feeds into the Centerlines feature class as the foreign key.
Appreciate the help!
I figured out a way to do it that does work. May not be the best way, but with limited scripting knowledge, what works is what I need at the moment.
##
// Identify Primary Key between relationship
id = $feature.streetnameid;
// Create the sql to select the related items in RoadCenterline Layer
var sql = "F_streetnameid = '" + id + "'";
var asset_view = FeatureSetByName($datastore,"RoadCenterline");
var assets = Filter(asset_view, sql);
var cnt = Count(assets);
return cnt
Just wanted to put it out there incase anyone came across this problem.
Is there a way to run this expression where you can group the data by attribute from a field in the related data?