Jul 04, 2024 06:29 AM
Hey folks,
I've put together a guide to Airtable scripting based on a scripting 'cheatsheet' notebook I've built up over time. It includes a mix of info from the official scripting docs and places like Google (and this forum) when the docs didn't have the answers.
Figured this info might be useful for others, so I turned it into a blog post:
https://simplescraper.io/blog/complete-guide-airtable-scripting
It covers the basics but also dives into some more advanced techniques. The idea is to have all this info in one place for quick reference.
Hope you find it helpful. Feel free to share any feedback or additional tips ✌️
Jul 04, 2024 10:39 PM
Hello @itsmike,
It's informative and useful for any starter, who knows a bit about JS.
I would like to get more on those topics if you get a chance.
1) Difference between Automation and Extension Scripting in Airtable.
2) How extension script Advanced Settings Options work.
I'll also try to create those from my side but I like the way you explain it.
👍
Jul 05, 2024 03:44 AM - edited Jul 05, 2024 03:45 AM
Hi,
I'm afraid you cannot create records with multiselect field in such way
// assume we've fetched this data from Shopify API for example
let shopifyOrders = [
{ id: '1001', customer: 'Alice', price: 150.00, items: ['Shirt', 'Pants'] },
{ id: '1002', customer: 'Bob', price: 75.50, items: ['Hat'] }
];
// transform Shopify data into Airtable record format
let shopifyOrdersTransformed = shopifyOrders.map(order => ({
fields: {
'Order ID': order.id * 1, // convert to number to match Airtable number field type
'Customer Name': order.customer,
'Price': order.price,
'Items': order.items // 'Items' must be a multiple-select field
}
}));
Instead of array of strings you need to pass array of objects like [{name:'Pants'} , {name:'Shirts'} ]
Jul 05, 2024 06:20 AM
You're correct @Alexey_Gusev , thanks for pointing this out. I've updated the guide.
Hi @dilipborad, the Difference between Automation and Extension Scripting is a great topic. I've some notes on this so will add a section to the guide soon. Thanks