So I’ve updated my code to:
async function query_Data(){
let arrResult = await queryApplications($w( ‘#input1’ ).value) ;
$w( “#table1” ).rows = arrResult.items;
if (arrResult.items.totalCount === 0 ){
$w( ‘#text26’ ).show();
}
else {
$w( “#table1” ).rows = arrResult.items;
$w( “#table1” ).expand();
}
}
However when I preview it I get
which relates to $w( “#table1” ).rows = arrResult.items; The query is no no longer returning results at the front end.
I’m calling this function from on ready:
export function searchbutton1_click(event) {
$w( ‘#text26’ ).hide();
$w( “#table1” ).collapse();
query_Data();
}
The jsw code is:
import wixData from ‘wix-data’ ;
export function queryApplications(Email) {
wixData.query( ‘Applications’ )
.eq( “applicantEmail” ,Email)
.find()
.then((results) => {
console.log(results.items);
})
. catch ((err) => {
console.log(err);
});
}
The jsw tests ok if I use a valid email address and returns 34 records. when I run it via the front end it also returns 34 records in the developer console, so the query is working front end to back, but it doesn’t like the results.