# Change one repeater button link keep the rest linked to database

**URL:** <https://forum.wixstudio.com/t/change-one-repeater-button-link-keep-the-rest-linked-to-database/52030>\
**Category:** Ask the community\
**Tags:** question, cms, code, wix\
**Created:** [August 30, 2023, 12:10pm UTC](https://forum.wixstudio.com/t/change-one-repeater-button-link-keep-the-rest-linked-to-database/52030 "2023-08-30T12:10:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jennifer\_Dean](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/jennifer_dean/32/82049_2.png) [@Jennifer\_Dean](https://forum.wixstudio.com/u/Jennifer_Dean)\
**Post date:** [August 30, 2023, 12:10pm UTC](https://forum.wixstudio.com/t/change-one-repeater-button-link-keep-the-rest-linked-to-database/52030/1 "2023-08-30T12:10:01Z")

</div>

Hello.  
I have a Repeater connected to dataset. Each window has a button connected to database. Is there a way to change one specific repeater button, have it linked to a url and keep the rest linked to database?

---

<div class="post-metadata">

**Author:** ![jeffreygillespie18](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/jeffreygillespie18/32/17733_2.png) [@jeffreygillespie18](https://forum.wixstudio.com/u/jeffreygillespie18)\
**Post date:** [August 31, 2023, 6:22am UTC](https://forum.wixstudio.com/t/change-one-repeater-button-link-keep-the-rest-linked-to-database/52030/2 "2023-08-31T06:22:57Z")

</div>

Can’t change design but can change link

---

<div class="post-metadata">

**Author:** ![gelecegiyazmak](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/gelecegiyazmak/32/27804_2.png) [@gelecegiyazmak](https://forum.wixstudio.com/u/gelecegiyazmak)\
**Post date:** [August 31, 2023, 11:07am UTC](https://forum.wixstudio.com/t/change-one-repeater-button-link-keep-the-rest-linked-to-database/52030/3 "2023-08-31T11:07:06Z")

</div>

You can manually write the ID of the button you want to connect to the ‘repeater’ dataset and change its link, or you can retrieve it from the collection. If you pull it from the collection, you can access the ID by writing result.items[row index].\_id, where the row is at the specified sequence number.

```javascript

// First solution
$w("#repeater1").onItemReady( ($item, itemData, index) => {
    //27789f76-82ae-4b7f-9b0c-d3d0e09cd9b2 is id of the row
    if(itemData._id === "27789f76-82ae-4b7f-9b0c-d3d0e09cd9b2"){
        $item("#button1").link = "https://www.example.com/";
    }
  });

// Second solution

import wixData from 'wix-data';

wixData.query("myCollection") 
    .find()  
    .then((result) => {

        let userId = result.items[2]._id

    $w("#repeater1").onItemReady( ($item, itemData, index) => {
        if(itemData._id === userId){
            $item("#button1").link = "https://www.example.com/";
        }
      });
  })
  .catch((err) => {
    console.log(err);
  });

```

---

<div class="post-metadata">

**Author:** ![user3492](https://avatars.discourse-cdn.com/v4/letter/u/958977/32.png) [@user3492](https://forum.wixstudio.com/u/user3492)\
**Post date:** [October 14, 2024, 3:42am UTC](https://forum.wixstudio.com/t/change-one-repeater-button-link-keep-the-rest-linked-to-database/52030/4 "2024-10-14T03:42:33Z")

</div>

> [@gelecegiyazmak](#):
>
> ```javascript
> import wixData from 'wix-data';
> 
> wixData.query("myCollection") 
> .find()  
> .then((result) => {
> 
> let userId = result.items[2]._id
> 
> $w("#repeater1").onItemReady( ($item, itemData, index) => {
> if(itemData._id === userId){
> $item("#button1").link = "https://www.example.com/";
> }
> });
> })
> .catch((err) => {
> console.log(err);
> });
> 
> ```

is “myCollection” the name of the dataset?
