Repeater showing duplicates only in published, not preview

I don’t think I have any duplicates in my database, but my repeater shows duplicates for multiple different entries only while in published mode. It doesn’t happen in preview. How can I resolve this so that my published mode only shows one instance of each entry.

Thanks

Hi Adam,

This forum is specifically for questions about Corvid by Wix.

Have you set up your repeater to display collection data using code? If so please end us a link to your site as well as a snippet of the code you are having an issue with.

If you have not added any code to your site please contact Wix Support .

Thank you!

Dara | Corvid Team

Yes, I did set it up using code! Sorry for not making that clear in the original post.

import {local} from 'wix-storage';
import wixData from 'wix-data';
import wixLocation from 'wix-location';

$w.onReady(function () {

//query function stuff
var sameWord = local.getItem("searchWord");
    $w("#iNanobodySearch").value = sameWord;
    $w("#iNanobodySearch").placeholder = sameWord;
    $w('#dynamicDataset').onReady(function() {
        search();
    local.setItem("searchWord","")
    $w("#iNanobodySearch").resetValidityIndication();
    $w("#iNanobodySearch").placeholder = "Search antigen name, sequence, or more";
    });
});


export function button5_click(event) {
        $w('#dynamicDataset').onReady(function() {
            search();
        });
}

function search() {
    wixData.query('Antigens')
    .limit(20)
    .contains('antigen',$w("#iNanobodySearch").value)
    .or(wixData.query('Antigens').contains('alternativeGeneNames',$w("#iNanobodySearch").value))
    .or(wixData.query('Antigens').contains('fullProteinName',$w("#iNanobodySearch").value))
    .or(wixData.query('Antigens').contains('uniprotId',$w("#iNanobodySearch").value))
        .find()
        .then(res =>{
 
            $w('#repeater1').data = res.items;

 //below pulls up no results display if necessary
 if (res.items.length) {
             $w('#columnStrip11').collapse();
             $w('#columnStrip12').expand();
             }
 else  {$w('#columnStrip11').expand();
       $w('#columnStrip12').collapse();
         }
    });

}

export function repeater1_itemReady($item, itemData, index) {
    makeRepeater();
}

export function makeRepeater() {
    $w("#repeater1").forEachItem( ($item, itemData, index) => {
 //variables for editing repeater
 let alternativeGeneNames= itemData.alternativeGeneNames;//text is the field you want to get its text
            $item("#text27").text = alternativeGeneNames; 
});
}


https://www.ringlabyale . com

Hey Adam,

I had a look at your Antigens collection and I can see where the issue is coming from.

You do not have any duplicates in the sandbox version of the collection (the one that shows on preview mode) but there are some duplicate items on the live collection.

If you just delete the duplicate items from the live collection and publish your site again you won’t have to worry. The issue isn’t with your code.

Hope this helps!

Dara | Corvid Team

Thank you so much! Is there any way to make my live version match my sandbox version (besides manually deleting all the duplicate entries)? Syncing doesn’t seem to do it.