I’ve been banging my head against the wall for a few hours, I can’t figure out why my selectRecordsAsync() does not pass anything into queryResult.
I think it has to do with me using an async function, but not sure why it wouldn’t work?
let poTable = 'PO/PI Paperwork'
let poView = 'test'
let btnPO = 'Client'
/////////FUNCTIONS
//Show PO list by client/////////
const poList = async () => {
let view = base.getTable(poTable).getView(poView);
let queryResult = await view.selectRecordsAsync();
return queryResult
}
///////////UI
if(btnPO === 'Client'){
console.log('Client')
let test = poList()
console.log(test)
}else if (btnPO ==='Number'){
console.log('Number')
}else if(btnPO === 'Yarn'){
console.log('Yarn')
}