# Dynamic URL through CMS

**URL:** <https://forum.wixstudio.com/t/dynamic-url-through-cms/70044>\
**Category:** Ask the community\
**Tags:** wix-studio, cms, question\
**Created:** [March 31, 2025, 4:05pm UTC](https://forum.wixstudio.com/t/dynamic-url-through-cms/70044 "2025-03-31T16:05:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![user5449](https://avatars.discourse-cdn.com/v4/letter/u/e79b87/32.png) [@user5449](https://forum.wixstudio.com/u/user5449)\
**Post date:** [March 31, 2025, 4:05pm UTC](https://forum.wixstudio.com/t/dynamic-url-through-cms/70044/1 "2025-03-31T16:05:17Z")

</div>

**Question:**  
I am having an issue with a URL field linking to external address.

**Product:**  
Wix Studio Editor.

**What are you trying to achieve:**  
I need to have dynamic URLs grabbed from a CMS field

**What have you already tried:**  
I created a URL field in my CMS that has an external address (points to a PDF elsewhere). when I preview or publish, the link disappears or if I test using a button, it doesnt work. I absolutely have the link and/or button connected to the dataset and linked to the proper field name called (specheet(URL) field. This IS a URL field. I confirmed hundreds of times its a URL field.

**Additional information:**  
anyone else have this issue?

---

<div class="post-metadata">

**Author:** ![CODE-NINJA](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/code-ninja/32/110588_2.png) [@CODE-NINJA](https://forum.wixstudio.com/u/CODE-NINJA)\
**Post date:** [April 18, 2025, 4:01pm UTC](https://forum.wixstudio.com/t/dynamic-url-through-cms/70044/2 "2025-04-18T16:01:18Z")

</div>

Try this one…

```javascript
$w.onReady(function () {
   // Assuming the dataset is connected to the page and the URL field is named 'specheet'
   let url = $w('#myDataset').getCurrentItem().specheet;
   $w('#myButton').link = url; // Set the button's link to the dynamic URL
});

```
