Hi CoA IT Department! Great question! If you're using ArcGIS Online (or Enterprise 10.9+), it's possible, it just cant be done with Arcade code.* I recommend taking a look at the "Join Features" tool in the Map Viewer Classic analysis tools. This tool can create a new hosted view that joins together your parent feature with the related table that can be used to drive symbology dynamically. I actually think this is ArcGIS Online's best kept secrets! This new view layer that contains the attributes of the parent and the related table can then be added to any map in the old or new Map Viewers and symbolized like any layer (normal style options or Arcade). I made a video about it: th-cam.com/video/gqC-EEw3nxY/w-d-xo.html Look at about 6 minutes and 40 seconds. Although this video is apart of a larger workflow, it'll still show how to configure the tool using your related fields. My example shows the use of a Global ID field and GUID field. If you used different fields when building your relationship class in ArcGIS Pro, it's fine to use those instead. Also, take a look at my comments to Jennifer Goldman in that video (she posted a few times). I provided some additional ideas and thoughts as to what is possible when you drive symbology with related records. Hope this helps! *In web maps, the ability to pull data from the related table to the parent is driven by the arcade "FeatureSetBy" function. While this can be used in pop-ups to pulled related data (as shown in this video), it cannot be used for symbology or labels. That's why I recommended the Join Features tool.
@@ericwagner5794 I've used this in the past, but it's not the best of solutions at all. Used Join to symbolise 15000 gully points and their related inspections over time, you gain one thing by lose another and then have to work around that to provide additional info. I just wish ESRI would expand Style Expressions to related features.
Hi Eric, these videos are the best. Thank you! I am getting an error in my OrderBy expression and the new version of Arcade doesn't seem to like it. Here's my code from your video: var relatedrecords = OrderBy(FeatureSetByRelationshipName($feature, "SE_PIPES_MAINT"),"DATE_CLEANED DES"); var cnt = Count(relatedrecords); var relatedinfo = ""; if (cnt > 0) { var info = First(relatedrecords)}; relatedinfo = " (" + Text(ToLocal(info.DATE_CLEANED), "MM/DD/Y") + ")";
//IIf(DateDiff(now, "DATE_CLEANED", "years") < 5, "Cleaned", "Not Cleaned") I'm trying to symbolize my sewer pipes based on the year they were cleaned. But the OrderBy expression does not work. Any ideas?
It's not the OrderBy expression that's not working, unfortunately/annoyingly you can symbolise by a related table attribute. You'll notice that the FSbyRel is not supported when creating an expression in styles. What I do is, in a latest inspection summary, use hex codes as a variable and colour certain attributes accordingly. Obviously not as good as seeing the symbols.
Great explanation! Looks super simple to implement, too.
Still baffled that basic relational visualization support needs an arcade expression and is not built into the UX. The solution still works.
How do we show the related tables attachment with the current inspection?
Where do you add in a "no records" return when there are no related records to sort?
I'm going to try this, but I'll just ask here...can we render symbology by an attribute in the related table?
Hi CoA IT Department! Great question!
If you're using ArcGIS Online (or Enterprise 10.9+), it's possible, it just cant be done with Arcade code.* I recommend taking a look at the "Join Features" tool in the Map Viewer Classic analysis tools. This tool can create a new hosted view that joins together your parent feature with the related table that can be used to drive symbology dynamically. I actually think this is ArcGIS Online's best kept secrets!
This new view layer that contains the attributes of the parent and the related table can then be added to any map in the old or new Map Viewers and symbolized like any layer (normal style options or Arcade). I made a video about it: th-cam.com/video/gqC-EEw3nxY/w-d-xo.html
Look at about 6 minutes and 40 seconds. Although this video is apart of a larger workflow, it'll still show how to configure the tool using your related fields. My example shows the use of a Global ID field and GUID field. If you used different fields when building your relationship class in ArcGIS Pro, it's fine to use those instead. Also, take a look at my comments to Jennifer Goldman in that video (she posted a few times). I provided some additional ideas and thoughts as to what is possible when you drive symbology with related records.
Hope this helps!
*In web maps, the ability to pull data from the related table to the parent is driven by the arcade "FeatureSetBy" function. While this can be used in pop-ups to pulled related data (as shown in this video), it cannot be used for symbology or labels. That's why I recommended the Join Features tool.
@@ericwagner5794 BUT when you use the Join in the Analysis tools, you lose your attachments.
yep - use the same code as an arcade expression in the symbology properties. then symbolize on the custom field.
@@69thunder7 you can't do that for relationship classes.
@@ericwagner5794 I've used this in the past, but it's not the best of solutions at all. Used Join to symbolise 15000 gully points and their related inspections over time, you gain one thing by lose another and then have to work around that to provide additional info. I just wish ESRI would expand Style Expressions to related features.
Hi Eric, these videos are the best. Thank you! I am getting an error in my OrderBy expression and the new version of Arcade doesn't seem to like it. Here's my code from your video:
var relatedrecords = OrderBy(FeatureSetByRelationshipName($feature, "SE_PIPES_MAINT"),"DATE_CLEANED DES");
var cnt = Count(relatedrecords);
var relatedinfo = "";
if (cnt > 0) { var info = First(relatedrecords)};
relatedinfo = " (" + Text(ToLocal(info.DATE_CLEANED), "MM/DD/Y") + ")";
//IIf(DateDiff(now, "DATE_CLEANED", "years") < 5, "Cleaned", "Not Cleaned")
I'm trying to symbolize my sewer pipes based on the year they were cleaned. But the OrderBy expression does not work. Any ideas?
It's not the OrderBy expression that's not working, unfortunately/annoyingly you can symbolise by a related table attribute. You'll notice that the FSbyRel is not supported when creating an expression in styles.
What I do is, in a latest inspection summary, use hex codes as a variable and colour certain attributes accordingly. Obviously not as good as seeing the symbols.