Jul 09, 2023 06:42 AM
I received the following prompt from Airtable's IDE, but I don't understand what it is asking me to do?
Could someone please give an example as to how I would pass options.fields to selectRecordsAsync()? TIA!
"Calling selectRecordsAsync() method without passing options.fields is discouraged. Passing options.fields allows you to request just the fields you need."
Solved! Go to Solution.
Jul 09, 2023 07:21 PM
Pass the field names as an array shown below
let query = await table.selectRecordsAsync({fields: ["Field name1","Field name2"]});
Jul 09, 2023 07:21 PM
Pass the field names as an array shown below
let query = await table.selectRecordsAsync({fields: ["Field name1","Field name2"]});
Jul 10, 2023 07:52 AM
Thank you, Sho!
I am a little unclear about a few things here, if you don't mind.
let query = await table.selectRecordsAsync({fields: ["Field name1","Field name2"]});
Do I use the word you typed in, "fields", then inside the brackets type the names of the fields(columns) from my base, which is what I did.
({fields: ["Field name1","Field name2"]})
records: Array(11)
0: Object
id: "recy5EPgK58mBL8Xz"
name: "Miako"
Jul 10, 2023 08:57 AM
Hi Sho, I just saw a little more detail in the Airtable docs that really helped me to understand what is going on, so thank you for getting me started here.