This Airtable scripting block automation imports orders from the "old-base sync (new orders)" table into the new order management system.
- Imports Order Items: Takes all SKU line items for a selected order number and creates them in the "new order sku" table
- Creates/Links Suppliers: Automatically creates supplier records in "suppliers info" if they don't exist, including copying company info attachments
- Updates Status: Sets all imported SKU records to "approved" status
- Marks as Imported: Updates source records with imported checkbox
- Updates Order Override: After automation creates the order record, updates the order#override field with the correct order number
- old-base sync (new orders): Source table with incoming orders
- new order sku: Destination for SKU line items
- suppliers info: Master supplier list
- orders: Order summary records (created by automation)
- ✅ Handles Airtable generated lookup values
- ✅ Copies attachment files from company info field
- ✅ Prevents duplicate supplier creation
- ✅ Updates single-select fields with proper format
- ✅ Batch processing for performance
- ✅ Comprehensive error handling and debug output
- Open the scripting block in your Airtable base
- Click the "Import Order" button on any record in "old-base sync (new orders)"
- The script will automatically process all SKUs for that order number
- Wait for completion message
Key constants at the top of the script can be adjusted:
- Table names
- Field names
- Wait times for automation triggers
- v1.0 (2025-01-13): Initial working version with full functionality