I’m working with an Airtable database and I can successfully pull records using the API. My current setup lets me get data from one field called “Location” but I need to grab values from additional fields too.
Right now I’m using console.log('Data found: ', record.get('Location')); to display the Location field. I want to also show data from a field named “Size” in the same output. I attempted console.log('Data found: ', record.get('Location', 'Size')); but this approach failed.
Just use template literals - way easier to read. Something like console.log('Data found: ${entry.get('Location')} - ${entry.get('Size')}'); works perfectly and keeps things simple. Don’t bother with extra variables unless you’re doing something more complex with the data later.
I found this when I had a project pulling dozens of fields from each record. entry.fields gets you straight to the raw data without all those get() calls. Just watch out - field names have to match Airtable exactly since it’s case-sensitive. Way cleaner when you need lots of fields, and the code’s easier to read.