You’ve probably all seen the following warning by now:
I’m guessing the deprecated behavior might still work well into 2022, but if you want to future-proof your scripts right now and/or depend on the old behavior, here’s the cleanest, functional way of mimicking it I’ve found so far:
const
table = base.getTable(yourTableName),
fields = table.fields.map( f => f.name),
query = await table.selectRecordsAsync({fields})
This particular destructuring syntax obviously depends on your scope being clean.
But in practice, I’d usually just write this:
const
table = base.getTable(yourTableName),
query = await table.selectRecordsAsync({
fields:table.fields.map(f=>f.name)
})
Either way, I figured I’ll share this and ask if anyone has figured out a quicker method.