need to add an action to zoom to selected on the map

09-28-2022 05:26 PM
Occasional Contributor

This is my first time using Experience Builder and I am stuck on this step:

On the map section I clicked:

Add a trigger 

Record Selection Changes

(and want to add an action of zoom to selected, but I can't figure it out)


I click Add Action and select a target pops up on the left but I don't see an option for zoom to selected.




0 Kudos
4 Replies
Esri Regular Contributor

Hi @L77, if you want to zoom to the selection, the map widget is not the trigger (but rather the action part). Thus, you should configure the trigger inside whichever widget you want to actually trigger the map zoom, such as a List widget (when you make the selection), instead of within the Map.


Here are more details of the message action and all related definitions for your reference: 

0 Kudos
Occasional Contributor

For my layout I have a map and a feature info widget:

I have it configured so when someone clicks on a point the data for the point shows up in the feature info box.



I set a trigger on the feature info widget to:

pan to 1 Selected

show on map 1 Selected

Zoom to 1 Selected


But when I click on a point on the map it doesn't zoom to the point.


I also tried selecting a point but it won't zoom to it automatically when I select the point:




0 Kudos
New Contributor III

To zoom in to a feature in a Map Widget, the action has to be triggered from another Widget, such as List Widget. Feature Info is also capable of triggering actions. You have to set up these actions under Message Action, not Data Action. However, I don't believe you you will be able to zoom in to a point just by clicking on it, since you can't send a Message Action to the same Widget that triggered it. But we can work around this.

ESRI should come up with a more elegant solution (if there is one I don't know), but to acomplish this behaviour you should: 

1. Create a new webmap that contains only the layer you are trying to select (e.g. points layer), remove basemap;

2. Add a second Map Widget (Map2) to your Experience (anywhere) and connect it to your new webmap;

3. Select your first Map Widget and add an Action to it this way:

 a) Add a trigger;

 b) Record selection changes

 c) Widgets/Map 2

 d) Zoom to

 e) Select data - Select the point layer within the main Map Widget.

4. Select your second Map Widget (Map 2) and add an Action to it like this:

 a) Add a trigger;

 b) Extent changes;

 c) Widgets/Map

 d) Zoom to

5. Try it out and see if when you select a point, the map will zoom to it. It might not work at first, if it doesn't save and refresh the page.

Let me know if you end up trying this.

New Contributor III

You, my friend, have saved me so much time. I did not realize it was the Message Action that controlled the zoom. That feels counterintuitive but I am glad that I found your comment! 

0 Kudos