Dynamic URL through CMS

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?

Try this one…

$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
});