List Widget Selection Changes After Zoom

1393
7
06-29-2021 07:32 AM
ChiZhang2
New Contributor II

I have a list, map and feature info widget, the app behaves like this: a click on a record on the list - map zooms to the area - list changes to records in the area - the selected record changes to another one that's not selected by me - sometimes it changes back to the one I selected, sometimes it stays with a random selected one. What should I change so that the selected record does not change?

Here is what I see: I select 4X-4984 on the list

before.jpg

Then the selected record changes to 4X-5113 after zoomed in. Sometimes it changes back to 4X-4984, sometimes not.

after.jpg

Here is the trigger on the map and list widget:

map action.jpg   list action.jpg

 

 

 

7 Replies
DaveFullerton
Occasional Contributor III

I don't understand what purpose is served by the actions circled below:

DaveFullerton_0-1625003150179.png

Have you tried it without them?  I don't need them to do what you describe in the workflow above (zoom to selected in list and filter visible records in list based on map extent).

0 Kudos
ChiZhang2
New Contributor II

I thought I needed to set up the selection triggers myself. After I remove those triggers the map does work the same as before.  However I still see the same behavior.

0 Kudos
DaveFullerton
Occasional Contributor III

Yes, Map and List have those triggers/actions by default.  It would be nice if Esri would provide documentation showing everywhere they have done that type of thing.

JonathanMcDougall
Occasional Contributor III

@ChiZhang2 

Important to remember what you're asking each element to do, and how you're asking the map to filter and the list to react. It can create some funny results, especially if you're asking the elements to almost do the same thing. 

Because you've got a Framework action, the Feature Info widget is being controlled too and will also display information. Generally when no features are selected, it will select the first record. So, as you use the list and map, the feature info is influencing what you are expecting to see.

I'd remove the feature info widget and replace with a card, in that card link data to a text box and tick "Selected Features", removing the tick from Default. Create your own view of the feature info. Example below, I've got a filter enabled, extent filter and the card is displaying my selection.

 

JonathanMcDougall_0-1625021785538.png

 

0 Kudos
ChiZhang2
New Contributor II

I think you are right it's the feature info widget that affects the selection. In my case I have an Arcade expression getting the "Affected areas" from a related table, however it does not show up in the text widget. Is there a way to work around that?

0 Kudos
JonathanMcDougall
Occasional Contributor III

@ChiZhang2 

Hopefully I get this round the right way, or a way that will help you understand what your process needs to be. I'll give my own example.

So, I've a footway features dataset with a related inspection table. There are roughly 28k features in the data and every one has at least one inspection - I want the user to see the feature and related inspection.
As the user pans the map, I want the list of selectable features to be filtered by the map view, I want the list to be selectable to give me the information from the related table.

I set the Map Action, which will apply to the Framework, to filter the list - just now I don't want the user clicking on a map feature. I only need one action at map level.

The list - I want to select a list item to give me the related table data. So I want to create an Action, in the list, to select data records from the related table, again this is at Framework. I usually create a card with text connected (by selected features) to the table data. The trigger data is the feature list, the action data is the related table - and you use the GlobalID to ParentID (GUID) as the relationship (or however your relationship fields are defined).  Therefore, that list selection will give you the related data in the card with connected text.

At this very simple level, there's no other actions need be applied. Map -> List -> Related Data. Just as an FYI, this will also work with views of the data created in ExpB too.

I'll see if I can publish the example for you here too, to reference.

0 Kudos
ChiZhang2
New Contributor II

Thanks a lot I never thought this way. Using your method I can get related data show up in the card. However it only shows one related record (block) - I usually have multiple. Is there any trick?

after2.jpg

Here is what I did: card text and list action.

card.jpg

list action2.jpg

0 Kudos