Select to view content in your preferred language

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

2163
19
10-24-2023 02:19 PM
SveinungBertnesRåheim
Occasional Contributor

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

 

19 Replies
AnnaHradecká
New Contributor III

I have the same problem with my data. I've been working long time to workflow of editing my many-to-many dataset in ExB and now I find out I can't create nice public application. 

My dataset is about movies (non spatial, in list widget), location (spatial in map) and scenes (connection table with movie and location attribute, in map also can be in list). Movies and Location are in M:N relationship connected by scenes. I want to select movie in list and by 2 steps action filter or select or flash, doesn't matter how, show locations in map. 

 

@SveinungBertnesRåheim  Have you find any workaround? And Do you have any Idea post about this problem, where I can give you a Kudo? 

SveinungBertnesRåheim
Occasional Contributor

I have not done more on this issue, just accepted that many-to many-relationships does not work i EB.
I agree with you, would be fine to be able to select in one table, then see the result in the map.
Lets hope ESRI work with this in coming editions.

0 Kudos
AnnaHradecká
New Contributor III

I've just created Idea post, because I think it is better way to report this issue than question, so you can find it here: Support many to many relationship in ExB - Esri Community

0 Kudos
ShengdiZhang
Esri Regular Contributor

Hi @SveinungBertnesRåheim @SerjStol ,

In the latest AGOL update, we support the use of layer's relationship when setting up message actions such as Record Selection Changes - Framework - Select data records, including M:N relationships. Can you try it to see if it meets your requirements?

Thanks,

Shengdi

SveinungBertnesRåheim
Occasional Contributor

I dont know if I understand you correctly. I still cannot get two actions to start in two different elements with one click.
Here is a link to the EB:
https://experience.arcgis.com/experience/8cf49126b4364e7aa1515612cdb2f6b5/

I see that I can enable "related data" in the data action tab. That makes it possible to select directly to the related path-segments, but it involves a lot of clicking and is not what I am looking for.

03.07.2024: The link was not shared public. Now it is. Sorry for that.

0 Kudos
SveinungBertnesRåheim
Occasional Contributor

I think this works! When you set the message action, you previously had to define the relationship. Now you can choose "Use layers relationship".

Relate_EB.png


You can filter and select the result. THis does what I want:

  • I click a row in a list (name of walking routes).
  • The segments related to this route are filtered and selected in the map.

What I cannot do so far, is to find a way to automatically zoom to the filtered / selected features. This is confusing, but the action "zoom to" is not available in with this relationship. I could add the select-widget and zoom to the selected feature(s), but that makes this more complex than I want it to be. Any suggestions on this topic?
You can see this "live" in this EB:
https://experience.arcgis.com/experience/8cf49126b4364e7aa1515612cdb2f6b

0 Kudos
AnnaHradecká
New Contributor III

I tested it my apps. It works nice for 1:N relationships and for simply M:N too. 

 

But I still have problem in my apps, where I have in one hosted feature service 3 layers (films, scenes and location) with relation (films:scenes 1:N and scenes:locations N:1). Scenes are for me connection table between films and locations. I need my user to edit it, so I create for them ExB. I can not find a way to edit all 3 layer in ExB, when it is usual M:N relationship. So this is the reason for my model. 

 

So where is the problem I need to select location in map by select film in list. It is now possible for M:N relation, but not for me. For me it could be better not to set "Use layer's relationship, but choose layer or table during which I can connect data. 

0 Kudos
SveinungBertnesRåheim
Occasional Contributor

I edit my M:N relationship in ArcGISpro. You want to do this in ExB? I dont know how easy that would be? My connection-table is only a technical one, consist only of two attributes - the primary keys from the to main tables. You have actual data in your connection table. 

0 Kudos
EmmaHatcher
Occasional Contributor

@SveinungBertnesRåheim @SerjStol 

It appears this has been implemented in ArcGIS Online with the June 2024 release! I just tested with feature action using a many-to-many relationship class in Experience Builder via the List widget and it worked- excited to hear what version of ArcGIS Enterprise this will be made available.

https://doc.arcgis.com/en/experience-builder/latest/get-started/whats-new.htm

EmmaHatcher_0-1719943208637.png

 

SveinungBertnesRåheim
Occasional Contributor

I am still not satisfied. With the new functionality, I can select a row and filter/select features in my map. But I can't find a way to zoom to or pan to theese features. The message action "zoom to" is not available with this setup. Should be possible? I want people to be taken to my selected/filtered features. Maybe @ShengdiZhang know if this is possible or not?

0 Kudos