# Dynamic url in Google Map connected to a CMS

**URL:** <https://forum.wixstudio.com/t/dynamic-url-in-google-map-connected-to-a-cms/56715>\
**Category:** Ask the community\
**Tags:** question, cms, code, wix\
**Created:** [February 26, 2024, 2:41pm UTC](https://forum.wixstudio.com/t/dynamic-url-in-google-map-connected-to-a-cms/56715 "2024-02-26T14:41:08Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Patrizia\_Castiglione](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/patrizia_castiglione/32/81171_2.png) [@Patrizia\_Castiglione](https://forum.wixstudio.com/u/Patrizia_Castiglione)\
**Post date:** [February 26, 2024, 2:41pm UTC](https://forum.wixstudio.com/t/dynamic-url-in-google-map-connected-to-a-cms/56715/1 "2024-02-26T14:41:08Z")

</div>

**Question:**  
Hi, I’ve created a dynamic Team(All) page connected to a CMS database containing the names, addresses and other information of a list of people. Each person has a Team(Name) page whose dynamic address is “…/team/{Name}”.  
I’ve connected this same dataset to a Google map and I’d like to insert the url of each page “…/team/{Name}” into each pin. This way I can see where the person is and read the corresponding information page. I’ve seen that the Google Map module doesn’t offer a connection to dynamic “/team/{Name}” url. So I manually entered the url of each “mysite/team/name\_i” page in a new url-type column. Do you know if there are more intelligent solutions?

**Product:**  
Wix editor

**What are you trying to achieve:**  
I’d like to click on a pin and read the “team/{Name}” page

**What have you already tried:**  
I manually entered the url of each “mysite/team/name\_i” page in the CMS connected to Google Map

**Additional information:**

---

<div class="post-metadata">

**Author:** ![anthony](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/anthony/32/79536_2.png) [@anthony](https://forum.wixstudio.com/u/anthony)\
**Post date:** [February 29, 2024, 9:46pm UTC](https://forum.wixstudio.com/t/dynamic-url-in-google-map-connected-to-a-cms/56715/2 "2024-02-29T21:46:29Z")

</div>

I don’t see a way to do this programmatically with Velo so what you have seems the best way.

---

<div class="post-metadata">

**Author:** ![Patrizia\_Castiglione](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/patrizia_castiglione/32/81171_2.png) [@Patrizia\_Castiglione](https://forum.wixstudio.com/u/Patrizia_Castiglione)\
**Post date:** [March 1, 2024, 10:14am UTC](https://forum.wixstudio.com/t/dynamic-url-in-google-map-connected-to-a-cms/56715/3 "2024-03-01T10:14:41Z")

</div>

Thank you for your reply Anthony

---

<div class="post-metadata">

**Author:** ![codequeen](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/codequeen/32/88960_2.png) [@codequeen](https://forum.wixstudio.com/u/codequeen)\
**Post date:** [March 1, 2024, 5:19pm UTC](https://forum.wixstudio.com/t/dynamic-url-in-google-map-connected-to-a-cms/56715/4 "2024-03-01T17:19:41Z")

</div>

There most definitely is a way to do this programmatically with Velo.

You can create a hook so that when the item is added or updated, it can automatically insert the appropriate URL value into the manual URL column that you created.

> **[beforeInsert - Velo API Reference - Wix.com](https://www.wix.com/velo/reference/wix-data/hooks/beforeinsert)**
>
> A hook that is triggered before an insert() operation. The beforeInsert() hook runs when: + The insert() function is called. + An action is performed on a ...

> **[beforeUpdate - Velo API Reference - Wix.com](https://www.wix.com/velo/reference/wix-data/hooks/beforeupdate)**
>
> A hook that is triggered before an update() operation. The beforeUpdate() hook runs when: + The update() function is called. + An action is performed on a ...

If Wix could just program the “link connects to” setting to connect to a native dynamic page via the same dataset settings then you wouldn’t have to code a hybrid solution like this.

#codequeen

---

<div class="post-metadata">

**Author:** ![Patrizia\_Castiglione](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/patrizia_castiglione/32/81171_2.png) [@Patrizia\_Castiglione](https://forum.wixstudio.com/u/Patrizia_Castiglione)\
**Post date:** [March 1, 2024, 5:45pm UTC](https://forum.wixstudio.com/t/dynamic-url-in-google-map-connected-to-a-cms/56715/5 "2024-03-01T17:45:36Z")

</div>

Thank you CodeQueen ! It sounds interesting

---

<div class="post-metadata">

**Author:** ![Patrizia\_Castiglione](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/patrizia_castiglione/32/81171_2.png) [@Patrizia\_Castiglione](https://forum.wixstudio.com/u/Patrizia_Castiglione)\
**Post date:** [March 2, 2024, 2:11pm UTC](https://forum.wixstudio.com/t/dynamic-url-in-google-map-connected-to-a-cms/56715/6 "2024-03-02T14:11:09Z")

</div>

It sounds interesting and it works ! Thank you CodeQueen !

---

<div class="post-metadata">

**Author:** ![codequeen](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/codequeen/32/88960_2.png) [@codequeen](https://forum.wixstudio.com/u/codequeen)\
**Post date:** [March 3, 2024, 2:50am UTC](https://forum.wixstudio.com/t/dynamic-url-in-google-map-connected-to-a-cms/56715/7 "2024-03-03T02:50:21Z")

</div>

Glad it worked for you!

If you could kindly mark that comment as “solution” so others know there is a solution, that would be much appreciated.

Welcome to the community!

---

<div class="post-metadata">

**Author:** ![user5330](https://avatars.discourse-cdn.com/v4/letter/u/ac91a4/32.png) [@user5330](https://forum.wixstudio.com/u/user5330)\
**Post date:** [March 19, 2025, 10:49pm UTC](https://forum.wixstudio.com/t/dynamic-url-in-google-map-connected-to-a-cms/56715/8 "2025-03-19T22:49:38Z")

</div>

Hi there, I am actually having the exact same issue. Perhaps I’m a bit more novice regarding code/Velo. I did read the referenced articles from Codequeen, but am not sure where to put this code and how a separate column within the CMS collection would get auto-populated with the URL

---

<div class="post-metadata">

**Author:** ![Patrizia\_Castiglione](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/patrizia_castiglione/32/81171_2.png) [@Patrizia\_Castiglione](https://forum.wixstudio.com/u/Patrizia_Castiglione)\
**Post date:** [March 30, 2025, 4:01pm UTC](https://forum.wixstudio.com/t/dynamic-url-in-google-map-connected-to-a-cms/56715/9 "2025-03-30T16:01:05Z")

</div>

Hello [user5330](https://forum.wixstudio.com/u/user5330),  
sorry for the delay of my post.  
You have to put your code in **data.js** file in the **back-end section**

 ![image](https://us1.discourse-cdn.com/wix/original/3X/9/c/9c60d731c4e176836942909d89c80794ef066402.png)
