I'm attempting to create a custom widget and struggling to query data from a feature layer. When I step thru the debugger, everything works, but no data rows are ever returned. The debugger shows the DataSource does indeed exist and everything looks fine, I simply cannot get any data to return. Here is a stripped down version of the code:
let qryParamsNow = [] as SqlQueryParams;
qryParamsNow.where = '1=1'
qryParamsNow.outFields = ['*']
let dataPortalUser = DataSourceManager.getInstance().getDataSourcesAsArray()[0] as QueriableDataSource
dataPortalUser.query(qryParamsNow)
.then((response) =>
{
const record = response.records[0];
console.log(record.getFieldValue('email'));
})
.finally()
{
// Any records?
const dtrResults = dataPortalUser.getRecords()
console.log(dtrResults[0].getFieldValue('email'));
}
As I step thru the debugger, I keep an eye on the network and that layer is never accessed. When it reaches the '.finally' the message shows unloaded. Prior to that the response message is 'pending'.
Thanks in advance.