# Sort repeating group on map marker click

**URL:** <https://forum.bubble.io/t/sort-repeating-group-on-map-marker-click/126485>\
**Category:** Database\
**Created:** [December 18, 2020, 9:45pm UTC](https://forum.bubble.io/t/sort-repeating-group-on-map-marker-click/126485 "2020-12-18T21:45:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cdp2231](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/cdp2231/32/77876_2.png) [@cdp2231](https://forum.bubble.io/u/cdp2231)\
**Post date:** [December 18, 2020, 9:45pm UTC](https://forum.bubble.io/t/sort-repeating-group-on-map-marker-click/126485/1 "2020-12-18T21:45:29Z")

</div>

Is it possible to sort a repeating group when someone clicks on a map marker? I’d like the item to be shown at the top of the repeating group list when the corresponding map marker is clicked.

Data Types  
Repeating Group (1 type) - Jobs  
Map (3 data types) - Showings, Open Houses, Other  
\*I’m using the Google maps BDK plugin.

---

<div class="post-metadata">

**Author:** ![nocodeventure](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/nocodeventure/32/247164_2.png) [@nocodeventure](https://forum.bubble.io/u/nocodeventure)\
**Post date:** [December 18, 2020, 10:56pm UTC](https://forum.bubble.io/t/sort-repeating-group-on-map-marker-click/126485/2 "2020-12-18T22:56:39Z")

</div>

Display the marker id inside a state and use that as a reference for sorting the data

---

<div class="post-metadata">

**Author:** ![laurag.garde](https://avatars.discourse-cdn.com/v4/letter/l/258eb7/32.png) [@laurag.garde](https://forum.bubble.io/u/laurag.garde)\
**Post date:** [July 27, 2021, 1:49pm UTC](https://forum.bubble.io/t/sort-repeating-group-on-map-marker-click/126485/3 "2021-07-27T13:49:42Z")

</div>

Hi, I know it’s been a while but trying my luck here 😉  
I don’t get how the marker ID would help with showing the clicked marker first… 🤔  
IDs are fixed and predetermined, no ? Or did I miss anything ?  
Thanks !

---

<div class="post-metadata">

**Author:** ![fellowdroner](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/fellowdroner/32/111707_2.png) [@fellowdroner](https://forum.bubble.io/u/fellowdroner)\
**Post date:** [October 29, 2021, 2:44pm UTC](https://forum.bubble.io/t/sort-repeating-group-on-map-marker-click/126485/4 "2021-10-29T14:44:48Z")

</div>

@cdp2231 hi!

Did you manage to do it?  
I think I am trying to do the same as you but can’t get it to work.

Best  
Francesco

---

<div class="post-metadata">

**Author:** ![cdp2231](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/cdp2231/32/77876_2.png) [@cdp2231](https://forum.bubble.io/u/cdp2231)\
**Post date:** [October 29, 2021, 4:40pm UTC](https://forum.bubble.io/t/sort-repeating-group-on-map-marker-click/126485/5 "2021-10-29T16:40:12Z")

</div>

Hey it’s been awhile since I worked on this, but I ended up doing a temporary solution in which the Repeating Group list updates to only show the map markers that are visible on the map. So when the user zooms in/out, the list updates accordingly. I figured this would be a short term solution while I continue to build the rest of the site functionality.  
(I plan on revisiting the suggestion from NoCodeVenture on displaying the marker id inside state to reference that particular cell/pin, but haven’t had time to do that yet.)

My current process is as follows:  
(Using Google Maps BDK plugin)  
Create Workflow \> When ‘Element’ ‘google map bdk map bounds are changed’ \> Display List Element = [select your repeating group] and Data Source = This ‘googlemap bdk’s markers’ VISIBLE MARKERS

This will update your repeating group to show only the visible markers on the map.

 ![1](https://us1.discourse-cdn.com/bubble/original/3X/1/9/19be975165a6975874164db3b9492f93567660ac.jpeg)

Just as fyi, I also have a separate workflow to ‘pan to the location’ of the map marker when it’s clicked.

 ![2](https://us1.discourse-cdn.com/bubble/original/3X/a/f/af07a3e83ed02efe34a395a20242c4ba56ca8462.jpeg)

I’ll update the post if I can accomplish the intended goal using the process NoCodeVenture has suggested.

Thanks
