# Dynamic Number Glitch When Using Filters in Wix Studio

**URL:** <https://forum.wixstudio.com/t/dynamic-number-glitch-when-using-filters-in-wix-studio/74543>\
**Category:** Ask the community\
**Tags:** wix-members-area, code, wix-studio, question\
**Created:** [October 28, 2025, 3:51am UTC](https://forum.wixstudio.com/t/dynamic-number-glitch-when-using-filters-in-wix-studio/74543 "2025-10-28T03:51:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![user6216](https://avatars.discourse-cdn.com/v4/letter/u/bcef8e/32.png) [@user6216](https://forum.wixstudio.com/u/user6216)\
**Post date:** [October 28, 2025, 3:51am UTC](https://forum.wixstudio.com/t/dynamic-number-glitch-when-using-filters-in-wix-studio/74543/1 "2025-10-28T03:51:35Z")

</div>

Hi everyone,

I’m facing an issue with dynamic numbering in a repeater when applying filters in Wix Studio. The numbering works fine initially, but once a filter is applied, the numbers don’t update correctly, they skip, or don’t match the filtered dataset.

Has anyone encountered this before? Is there a reliable workaround or code solution to make the numbering re-generate properly after filtering?

Thanks in advance for any help!

 ![Capture](https://us1.discourse-cdn.com/wix/original/3X/b/1/b117ea498c758d3b94757d7bdf071b64fb9b51ff.png)

---

<div class="post-metadata">

**Author:** ![Rob](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/rob/32/84134_2.png) [@Rob](https://forum.wixstudio.com/u/Rob)\
**Post date:** [October 30, 2025, 3:37pm UTC](https://forum.wixstudio.com/t/dynamic-number-glitch-when-using-filters-in-wix-studio/74543/2 "2025-10-30T15:37:05Z")

</div>

Is this being done via code? If so, can you share the code.

I figure that it might be related that the filtering isn’t updating the index number.

---

<div class="post-metadata">

**Author:** ![user6216](https://avatars.discourse-cdn.com/v4/letter/u/bcef8e/32.png) [@user6216](https://forum.wixstudio.com/u/user6216)\
**Post date:** [October 31, 2025, 7:05am UTC](https://forum.wixstudio.com/t/dynamic-number-glitch-when-using-filters-in-wix-studio/74543/3 "2025-10-31T07:05:23Z")

</div>

Hi @Rob Here’s the code that implement in the editor site:

```javascript
// // Access the repeater and handle each item// $w(‘#repeater1’).onItemReady(($item, itemData, index) => {// const richText = $item(‘#text45’);

// // Get the HTML content of the Rich Text element// let richTextHtml = richText.html;

// // Check if there are any links ( tags) in the HTML content// if (richTextHtml.includes('<a ')) {// // Update the link target to ‘_self’ to ensure links open in the same window// richTextHtml = richTextHtml.replace(/<a /g, '<a target=“_self” ');

// // Set the updated HTML back to the Rich Text element// richText.html = richTextHtml;// }// });

// let authorFullname = “Dulanga Weerakoon, Vigneshwaran Subbaraju, Joo Hwee Lim, Archan Misra”;// let authors = authorFullname.split(“,”);// console.log(authors);// // Run when the repeater is ready// $w(“#repeater1”).onItemReady(($item, itemData, index) => {// console.log(itemData); // Log item data to inspect// // Check if the author has published based on the isPublished field// if (itemData.isPublished) {// $item(“#button1”).show(); // Show the button if published// } else {// $item(“#button1”).hide(); // Hide the button if not published// }// });// });

// $w.onReady(function () {// // Make sure to use the correct ID of the Rich Text element// $w(‘#richTextBox1’).style.backgroundColor = “transparent”;// });

// $w(‘#richTextBox1’).onBlur((event) => {

// })

// $w(‘#richTextBox1’).onChange((event) => {

// })

// $w(“#dataset1”).onReady( () => {// let item = $w(“#dataset1”).getCurrentItem();// if (item.Text) {// $w(“#text48”).show();// } else {// $w(“#text48”).collapse();// $w(“#text48”).hide();// }

// // if (item.URL) {// // $w(“#text50”).show();// // } else {// // $w(“#text50”).collapse();// // $w(“#text50”).hide();// // }// } );import wixData from “wix-data”;

$w.onReady(() => {// Assuming your dataset is connected to the repeater$w(“#dataset1”).onReady(() => {let items = $w(“#dataset1”).getItems(0, $w(“#dataset1”).getTotalCount()).then((result) => {let total = result.items.length;$w(“#repeater2”).onItemReady(($item, itemData, index) => {// Add numbering dynamically$item(“#text59”).text = (index + 1).toString();});});});});

$w.onReady(() => {$w(“#repeater2”).onItemReady(($item, itemData) => {const authors = itemData.authorsArray;const doi = itemData.doi;const maxButtons = 9;

let buttonIndex = 0; // Tracks which button to populate

for (let i = 0; i < authors.length; i++) {
  if (authors[i].link) { // Only show authors with a link
    const buttonId = `#authorButton${buttonIndex}`;
    $item(buttonId).label = authors[i].name;
    $item(buttonId).link = authors[i].link;
    $item(buttonId).target = "_blank";
    $item(buttonId).expand();
    buttonIndex++;
  }
}

// Hide remaining buttons
for (let j = buttonIndex; j < maxButtons; j++) {
  $item(`#authorButton${j}`).collapse();
}

if (!doi || doi === "") {
  $item("#button2").collapse();
}

});});

```
