Help refreshing a repeater

I have three repeaters. The first one lets you search for a person which loads the person’s saved tutorials in the 3rd repeater. You can then search for tutorials in the second repeater and add them to the person’s saved tutorials. Right now everything works correctly but the 3rd repeater doesnt display the new file unless I click back on the person again. How do I get the repeater to refresh with the $item( “#watchLater” ).onClick((event) => { ???

I have tried to simply put $w( “#watchLate” ).refresh(); in the onClick event but nothing happens. I have tried a few ways actually I can’t seem to get it to refresh. below is a screen shot and my code for the page.

import { local } from ‘wix-storage’ ;
import wixData from ‘wix-data’ ;
import wixWindow from ‘wix-window’ ;
import wixLocation from ‘wix-location’ ;
import wixUsers from ‘wix-users’ ;

let user = wixUsers.currentUser;
let userId = user.id;
let isLoggedIn = user.loggedIn;
let fadeOptions = { “duration” : 2000 , “delay” : 1000 };
user.getRoles()
.then((roles) => {
let firstRole = roles[ 0 ];
let roleName = firstRole.name; // “Role Name”
let roleDescription = firstRole.description; // “Role Description”
});

/////// BEGIN LOAD TUT SEARCH
$w.onReady( function () {
$w( “#searchBar” ).onKeyPress((event) => {
if (event.key === “Enter” ) {
runtutSearch1()
}
})
});

function runtutSearch1() {
let word = $w( “#searchBar” ).value;
local.setItem( “searchWord” , word);
var sameWord = local.getItem( “searchWord” );
$w( “#searchBar” ).value = sameWord;
$w( “#searchBar” ).placeholder = sameWord;
$w( ‘#tutSearch’ ).onReady( function () {
runtutSearch2();
});
}

function runtutSearch2() {
wixData.query( ‘Tutorial_search’ ).contains( ‘tut_keywords’ , $w( “#searchBar” ).value)
.or(wixData.query( ‘Tutorial_search’ ).contains( ‘tut_title’ , $w( ‘#searchBar’ ).value))
.or(wixData.query( ‘Tutorial_search’ ).contains( ‘tut_desc’ , $w( ‘#searchBar’ ).value))
.limit( 50 )
.find()
.then(res => {
$w( ‘#repeater1’ ).data = res.items;

    }); 

}
////// END LOAD TUT SEARCH

/////// BEGIN LOAD MEMBER SEARCH
$w.onReady( function () {
$w( “#memberSearchbar” ).onKeyPress((event) => {
if (event.key === “Enter” ) {
runMemSearch1()
}
})
});

function runMemSearch1() {
let mword = $w( “#memberSearchbar” ).value;
local.setItem( “msearchWord” , mword);
var sameWord = local.getItem( “msearchWord” );
$w( “#memberSearchbar” ).value = sameWord;
$w( “#memberSearchbar” ).placeholder = sameWord;
$w( ‘#members’ ).onReady( function () {
runMemSearch2()
});
}

function runMemSearch2() {
wixData.query( ‘my_members’ ).contains( ‘member_firstname’ , $w( “#memberSearchbar” ).value)
.or(wixData.query( ‘my_members’ ).contains( ‘member_lastname’ , $w( ‘#memberSearchbar’ ).value))
.or(wixData.query( ‘my_members’ ).contains( ‘my_membersemail’ , $w( ‘#memberSearchbar’ ).value))
.limit( 1000 )
.find()
.then(res => {
$w( ‘#listRepeater’ ).data = res.items;

    }); 

}

$w.onReady( function () {
$w( “#watchLate” ).onReady(() => {
$w( “#listRepeater” ).onItemReady(($item, itemData, index) => {
$item( “#watchLoad” ).onClick((event) => {

const item = $item( ‘#members’ ).getCurrentItem();
let $filter = item.my_member_id;

let my_member_id = item.my_member_id;
local.setItem( “memberid” , my_member_id);

            $w( "#watchLate" ).setFilter(wixData.filter().contains( 'my_member_id' , $filter)) 
            console.log() 

        }); 
    }); 
}); 

});
////// END LOAD MEMBER SEARCH

////// START SELECT AND INSERT
$w.onReady( function () {
$w( “#tutSearch” ).onReady(() => {
$w( “#repeater1” ).onItemReady(($item, itemData, index) => {
$item( “#watchLater” ).onClick((event) => {

const item = $item( ‘#tutSearch’ ).getCurrentItem();
var my_member_id = local.getItem( “memberid” );

            wixData.insert( 'WatchLater' , { item, my_member_id }); 

const my_new_item = $item( ‘#members’ ).getCurrentItem();
let $filter = item.my_member_id;

            $w( "#watchLate" ).setFilter(wixData.filter().contains( 'my_member_id' , $filter)) 

        }); 
    }); 
}); 

});

Hello.

Try to refresh the dataset connected to the watchLater repeater.

If the issue persists, share your site link and the name of the page with the issue so that we can take a closer look.

Good luck!