Fresh pair of eyes.

What is the issue here. Something with that last few lines.
Thanks.
// For full API documentation, including code examples, visit Velo API Reference - Wix.com
import { session } from ‘wix-storage’ ;
import wixData from ‘wix-data’ ;

$w.onReady( function () {
//TODO: write your page related code here…
let state = session.getItem( “state” ); // “value”
let service = $w( ‘#dynamicDataset’ ).getCurrentItem(); // “value”

console.log(state) 
console.log(service) 

$w( "#dataset2" ).setFilter(wixData.filter() 
    .contains( "title" , state) 
) 
$w.onReady( () => { 

$w( “#dataset1” ).onReady( () => {
$w( “#dataset1” ).refresh();
then( () => {
console.log( “Done refreshing the dataset” );
} ):

Try this →

import { session } from ‘wix-storage’ ;
import wixData from ‘wix-data’ ;
$w.onReady( function () {
let state = session.getItem( “state” );
let service = $w( ’ #dynamicDataset ’ ).getCurrentItem(); console.log(state);
console.log(service); $w( " #dataset2 " ).setFilter(wixData.filter() .contains( “title” , state)
)
});

Thanks. Truly appreciate your suggestion
What about refresh()