# Link Repeater Text to URL

**URL:** <https://forum.wixstudio.com/t/link-repeater-text-to-url/1327>\
**Category:** Ask the community\
**Tags:** code, question\
**Created:** [May 7, 2021, 9:35am UTC](https://forum.wixstudio.com/t/link-repeater-text-to-url/1327 "2021-05-07T09:35:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mehrankhanyz](https://avatars.discourse-cdn.com/v4/letter/m/b3f665/32.png) [@mehrankhanyz](https://forum.wixstudio.com/u/mehrankhanyz)\
**Post date:** [May 7, 2021, 9:35am UTC](https://forum.wixstudio.com/t/link-repeater-text-to-url/1327/1 "2021-05-07T09:35:29Z")

</div>

Hello Forum,

I have been searching for a way to connect a text box in my repeater to the associated URL link within my dataset. I found a couple of previous posts on this topic, but none of the example codes/solutions have worked for me thus far.

I am trying to add a section of recent posts

 ![](https://us1.discourse-cdn.com/wix/original/3X/7/3/73f6447db7bc67f2cdcddfe7710ba85622b7bce3.png)

I have used the following code from here :

import wixLocation from ‘wix-location’ ;  
import wixData from ‘wix-data’ ;

$w . onReady ( function () {  
$w ( “#dataset1” ). onReady ( () =\> {  
$w ( “#repeater4” ). onItemReady ( ( $item , itemData , index ) =\> {

```
        $item ( "#text18" ). onClick (( event ) => { 

```

let myURL = itemData . website  
console . log ( myURL )  
console . log ( **typeof** myURL )  
wixLocation . to ( myURL )  
}); });  
}): });

When I tried to change my URL to any value like for example if I put  
let myURL = "https://www.google .com" so its work fine.

Here is the error I am getting :

 ![](https://us1.discourse-cdn.com/wix/original/3X/1/6/160d3f6c809e27524c8d1ee68254c256d6a76d24.png)

Please help me, what I am doing wrong or send me the correct code if you have. I appreciate your help. Thank you

---

<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:** [May 7, 2021, 12:52pm UTC](https://forum.wixstudio.com/t/link-repeater-text-to-url/1327/2 "2021-05-07T12:52:08Z")

</div>

1. Do you have connected your DATASET with a DATABASE?
2. Do you have checked the IDs of —\> DATASET / REPEATER / TEXT ?
3. Which result do you get for —\> console.log(itemData) ?
4. Can you show a little excerpt of the related DB ?
