Select to view content in your preferred language

Many to Many Relationship and Pop Ups

394
1
10-09-2024 03:24 AM
Labels (1)
CMcFadden
Emerging Contributor

I am trying to visualise Origin Destination pairs in ArcGIS pro with the intention to migrate to ArcGIS Online as a dashboard once I have the functionality as I want in ArcPro.

I am using ArcGIS Pro and I have 2 spatial tables and one non spatial table. If it makes it any easier the two spatial tables are the exact same, one is just functioning as the origin polygon and the other the destination. The non spatial table records all trips between origins and destinations and the number of times this trip was done. I've attached a basic diagram so you can see what the 3 tables look like.

CMcFadden_2-1728468146120.png

 

 

This is a many to many cardinality relationship, as one polygon can travel to many polygons and a destination can have many origins.

What I would like to achieve is two things:

  1. Be able to click on any polygon and see all listed "related" destination polygons that origin polygon travelled to.
  2. Also see the number of people who made this trip (as shown in the non spatial table) within in the pop up.

Kind of shown below:

CMcFadden_1-1728468049983.png

 

I have achieved Step 1 using the Table To Relationship Class  tool. When I click on an origin polygon the corresponding destination polygons related to it in the polygon. Also the destination polygons "flash" when selected in the pop-up. 

I don't know how to implement Step 2 though. I can't seem to find a way to show the trip number from the non -spatial table within the same pop up. Is there a setting to do this? Or possibly a way using Arcade Expressions?

 

Anyone have any suggestions?

Tags (2)
0 Kudos
1 Reply
KenBuja
MVP Esteemed Contributor

You can use the FeatureSetByRelationshipName function to get those related records. You can loop through those related records to build your output table for the popup