Many to many relationship in Experience builder - show track segments in map

1610
12
10-24-2023 02:19 PM
Labels (1)
SveinungBertnesRåheim
New Contributor III

As far as I have experienced, Experience builder does not read or support established relationships. But! EB makes it possible to establish relationships regardless of defined relationships with Actions.

My issue:
I have a line dataset with track segments. Theese track segments are related to different maintracks. On maintrack consists of many segments. And one segment can be related to many maintracks. This is a classic many-to-many relationship. 
It is built in ArcGISpro and then published to one feature service. The feature service consists of

  1.  one line layer (track segments). ID: GlobalID
  2. table1 (main tracks). MaintrackID
  3. table2. Relation-table. Consists of to attributes, GlobalID_Tracksegments and MaintrackID

In Experience builder, I have

  1. added a map with the tracksegments.
  2. Added List widget1 with the main tracks-table
  3. Added List widget2 with the relation-table

I have added theese actions to listwidget1:

  1. Record selection changes ->Framework -Filter data records> Triggerdata Maintracktable, Actiondata Relationtable, Action-connection maintrackID.
  2. Record selection changes ->Framework -Select data records> Triggerdata Maintracktable, Actiondata Relationtable, Action-connection maintrackID.

SveinungBertnesRheim_0-1698181327652.png

This put up a one-to many-connection between the maintrack-table and the relation-table.

Then I have added List-widget2 with the relation-table. For this table, I have added joins(Actions) both ways, to the map-features and to the maintracktable. 

SveinungBertnesRheim_1-1698181487599.png

This widget has a many to one relationship to the line feature service (the tracks). I.e. one track segment can relate to many rows in the relationship-table.

My theory is / what I want to do is:

When I select a row in List1 (Main tracks), I filter and select all common rows in the relationtable. This relation-table has action to filter and select track segments in the line feature service in the map. The result should be filtered and selected track segments in the map.

But!
This does not happen. It will happen if I interact with list2 with the mouse. If I click ONE time in list2, the filter and select in the map is activated. EB does not recognize the filter and selection before I have physically clicked in the list. Although the list is already filtered and selected through the action in list1.


The map consists of test data and is publicly available:
https://experience.arcgis.com/experience/0a8cae796c1d492f87285893b4434432

The map also inclueds the Elevation profile widget. I hoped to activate that one as well, but nothing happens

If anyone wants to try to set up the case, here is the hosted feature service:
https://bodo-kommune.maps.arcgis.com/home/item.html?id=e8523b8722e4456c9ea958f11753a33a

 

12 Replies
JeffreyThompson2
MVP Regular Contributor

I tried out your Experience. It looks like your Lists are interacting in a logical way, but your map is not filtering. Try adding the Map > Filter Action.

JeffreyThompson2_0-1698237417761.png

 

GIS Developer
City of Arlington, Texas
SveinungBertnesRåheim
New Contributor III

I tried to add a Map > Filter Action to the Relationship table. I had to configure it like this:

SveinungBertnesRheim_1-1698239512550.png

Still behave the same way - no action. Thanks anyway for the reply.

 

0 Kudos
JasonBOCQUET
Occasional Contributor II

If I correctly understand :

Your first list is your point of entry right? If you clicking on "1000m" you want the application show you in the list 2 only the "2" value and highlight on the map that was selected from the second list?

 

To make this, you have to create 4 framework action in the list 1 widget. One action of selection btw your list 1 and list 2, the same action but to filter. And two other action to select and filter between list 1 and the map. 

SveinungBertnesRåheim
New Contributor III

I dont think this will work. This is a many to many relationship. There are no connection between list 1 and the map. The connection is via list 2. I dont need to show list2 in the Experience builder, I do it for debugging purposes, to try to see where it fails.
I found a picture that show my schema:

SveinungBertnesRheim_1-1698262535552.png

Source: https://help.claris.com/archive/help/17/fmp/en/index.html#page/FMP_Help/many-to-many-relationships.h...

You could replace the student table with my "Main tracks"-table, the Enrollments with my relationship-table and the "classes" with my track segment feature class.  
So I cant see it it possible to put an Action from the left tabel to the right one. I have to go through the connectiontable, the relationshiptable.

JasonBOCQUET
Occasional Contributor II

Ok, your problem is that you have not common ID between your "Main Tracks" table and your Track Segment Feature class right ?

So you have to use a secondary table (Relationship table) to get the connexion.

If you parameter a map action with 2 different ID, it doesn't work and the map is emptied of its information.

I think you have to find a common ID between your first list and your feature layer to get what you want.

 

0 Kudos
SveinungBertnesRåheim
New Contributor III

I understand that is possible. But thats not a solution to a many-to-many relationship. And thats what I am searching.

0 Kudos
AlixVezina
Esri Regular Contributor

@SveinungBertnesRåheim 

When I select a row in List1 (Main tracks), I filter and select all common rows in the relationtable. This relation-table has action to filter and select track segments in the line feature service in the map. The result should be filtered and selected track segments in the map.

But!
This does not happen. It will happen if I interact with list2 with the mouse. If I click ONE time in list2, the filter and select in the map is activated. EB does not recognize the filter and selection before I have physically clicked in the list. Although the list is already filtered and selected through the action in list1.

Actions are only triggered widget 1 > widget 2 and do not cascade widget 1 > widget 2 > widget 3.

In other words, if you select a record in List 1, it will impact List 2. But if List 2 also has an action set against another widget, that 3rd widget will not be impacted unless you specifically click within List 2.

SveinungBertnesRåheim
New Contributor III

Thank you! This is what I have experienced, I hoped it was possible to get it work.  This means that it is not possible to use a dataset with many to many relationship in experience builder? At list not this way? It would have been smooth if it worked. Any other suggestions?

SerjStol
New Contributor III

I also expected M:N relationship to work in Action Triggers of the Map Widget or other widgets. This does not seem to be the case. As the relationship requires an intermediary table which is essentially stored in the relationship class itself when you create it via ArcGIS Pro or ArcMap. Action Triggers seem to require direct Origin and Foreign key between two layers, which makes it only feasible for One to Many relationships. Unless you structure your data with duplicate segments/features in both origin and destination tables that have corresponding linking ID's, the triggers won't work. I hope ExB team have this on their agenda to support M:N relationship classes.