- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Dec 21, 2023 11:08 PM
Hi, I am trying to get selectRecordsAsync() to work. I looked up some older posts here and know that the old version was depricated I have to add an array of the field values, however it's still not working.
Here is my code:
Solved! Go to Solution.
Accepted Solutions
![Jack_Manuel Jack_Manuel](https://community.airtable.com/legacyfs/online/avatars/2X/7/72b661fef72712ac1cf85afa4b9ae4d004654489.jpeg)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Dec 22, 2023 12:21 AM
As your function is async you need to await the call to it.
async function updateCompanyDomains() {
let table = base.getTable("MyTableName");
let queryResult = await table.selectRecordsAsync({fields: table.fields});
console.log(queryResult)
}
await updateCompanyDomains()
![Jack_Manuel Jack_Manuel](https://community.airtable.com/legacyfs/online/avatars/2X/7/72b661fef72712ac1cf85afa4b9ae4d004654489.jpeg)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Dec 22, 2023 12:21 AM
As your function is async you need to await the call to it.
async function updateCompanyDomains() {
let table = base.getTable("MyTableName");
let queryResult = await table.selectRecordsAsync({fields: table.fields});
console.log(queryResult)
}
await updateCompanyDomains()
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Dec 22, 2023 12:54 AM
Thanks so much, Jack_Manuel, that did the trick. Guess a Java Script basic - must refresh my JS brain cells.
![Jack_Manuel Jack_Manuel](https://community.airtable.com/legacyfs/online/avatars/2X/7/72b661fef72712ac1cf85afa4b9ae4d004654489.jpeg)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Dec 22, 2023 01:06 AM
It happens to the best of us!
![](/skins/images/75AB00B4920FD2D67A8CABF77C9DECC4/responsive_peak/images/icon_anonymous_message.png)