Sharing Apps Script & Setup Instructions
How to Share the Apps Script
Method 1: Share the Google Sheet (Easiest)
The Apps Script is embedded in the Google Sheet, so sharing the sheet shares the script.
-
In your Google Sheet:
- Click Share (top right)
- Add the person’s email
- Give them Editor access (needed to run scripts)
- Click Send
-
They will:
- Receive access to the sheet
- Have access to the script automatically
- Need to set up their own trigger (see below)
Method 2: Export/Import Script (If Needed)
If you want to share just the script code:
-
Export:
- Extensions → Apps Script
- File → Download → .gs file
- Share the downloaded file
-
Import:
- They create a new Google Sheet
- Extensions → Apps Script
- File → New → Script file
- Paste the code
- Save
Setup Steps in the Google Sheet
Step 1: Verify Sheet Names
Make sure these sheets exist with exact names:
- ✅
Wholesale Customers Data - From Snowflake(source) - ✅
Report - All Wholesale Customers(destination)
To check:
- Look at the sheet tabs at the bottom
- Names must match exactly (case-sensitive, including spaces)
Step 2: Set Up Headers in Report Sheet
- Go to “Report - All Wholesale Customers” sheet
- Row 1 should have headers:
- Copy headers from “Wholesale Customers Data - From Snowflake” sheet
- Or manually add: Customer ID, Email, Full Name, Phone, Company Name, etc.
- Headers should be static text (not formulas)
Step 3: Verify Script is Installed
- Extensions → Apps Script
- Verify the code is there:
- Should see
copyWholesaleData()function - Should see
setupDailyTrigger()function - Should see
manualCopy()function
- Should see
Step 4: Set Up Daily Trigger
Option A: Using the Setup Function (Easiest)
- In Apps Script editor:
- Select
setupDailyTriggerfrom function dropdown - Click Run (▶️)
- Authorize permissions when prompted
- You’ll see: “Daily trigger set up! Data will copy automatically at 6 AM.”
- Select
Option B: Manual Trigger Setup
- In Apps Script editor:
- Click Triggers icon (⏰) in left sidebar
- Click + Add Trigger (bottom right)
- Configure:
- Function to run:
copyWholesaleData - Event source:
Time-driven - Type:
Day timer - Time:
6am to 7am(or your preferred time)
- Function to run:
- Click Save
- Authorize permissions
Step 5: Test the Script
-
Run manually to test:
- In Apps Script: Select
manualCopyfunction - Click Run (▶️)
- Authorize if prompted
- In Apps Script: Select
-
Check the result:
- Go to “Report - All Wholesale Customers” sheet
- Data should appear starting from row 2
- Headers in row 1 should remain unchanged
Step 6: Add Filters (Optional)
Once data is copied:
- Select row 1 (headers)
- Data → Create a filter
- Filters will work normally (no formula conflicts!)
For the Person Receiving the Script
First-Time Setup Checklist
- Access the Google Sheet (shared with them)
- Verify sheet names match:
Wholesale Customers Data - From SnowflakeexistsReport - All Wholesale Customersexists
- Check headers in Report sheet:
- Row 1 has column headers (static text)
- Open Apps Script:
- Extensions → Apps Script
- Verify code is present
- Set up trigger:
- Run
setupDailyTrigger()function - OR manually add trigger via Triggers sidebar
- Run
- Test the script:
- Run
manualCopy()function - Verify data copies correctly
- Run
- Verify automatic run:
- Check trigger is set (Triggers sidebar)
- Wait for scheduled time or test manually
Sharing Checklist
Before Sharing
- Script code is saved in Apps Script
- Sheet names are correct
- Headers are set up in Report sheet
- Script has been tested and works
When Sharing
- Share Google Sheet with Editor access
- Provide these instructions to the recipient
- Let them know they need to:
- Set up their own trigger (one-time)
- Authorize permissions (one-time)
Permissions & Authorization
What Permissions Are Needed
The script needs:
- ✅ Read access to source sheet
- ✅ Write access to destination sheet
- ✅ Access to Google Sheets API
Authorization Process
-
First time running script:
- Google will prompt for authorization
- Click “Review permissions”
- Choose your account
- Click “Advanced” → “Go to [Project Name] (unsafe)”
- Click “Allow”
-
Why “unsafe”:
- Google shows this for unverified apps
- It’s safe if you trust the code
- Your script is private to your organization
Troubleshooting for Recipients
”Sheet not found” Error
Problem: Script can’t find source or destination sheet
Solution:
- Verify sheet names match exactly
- Check for typos or extra spaces
- Sheet names are case-sensitive
”Permission denied” Error
Problem: Script doesn’t have access
Solution:
- Ensure they have Editor access to the sheet
- Re-authorize permissions
- Check trigger is set up correctly
Trigger Not Running
Problem: Daily copy isn’t happening
Solution:
- Check Triggers sidebar (⏰ icon)
- Verify trigger exists and is enabled
- Check execution log for errors
- Test manually with
manualCopy()
Data Not Copying
Problem: Script runs but no data appears
Solution:
- Check source sheet has data
- Verify source sheet name is correct
- Check execution log for errors
- Ensure destination sheet has headers in row 1
Quick Reference: Setup Steps
For You (Initial Setup)
- ✅ Create script in Apps Script
- ✅ Save script
- ✅ Set up daily trigger
- ✅ Test with
manualCopy() - ✅ Share sheet with Editor access
For Recipient (First Time)
- ✅ Open shared Google Sheet
- ✅ Verify sheet names exist
- ✅ Check headers in Report sheet
- ✅ Open Apps Script (Extensions → Apps Script)
- ✅ Run
setupDailyTrigger()function - ✅ Test with
manualCopy() - ✅ Verify trigger is set (Triggers sidebar)
Alternative: Share Script Code Only
If you want to share just the code (not the sheet):
Export Script
- Extensions → Apps Script
- File → Download → .gs file
- Share the .gs file
Recipient Imports
- Create new Google Sheet
- Extensions → Apps Script
- Delete default code
- Paste your script code
- Save
- Follow setup steps above
Summary
To share:
- Share the Google Sheet with Editor access
- Script is automatically included
Recipient needs to:
- Set up their own trigger (one-time)
- Authorize permissions (one-time)
- Test the script
No deployment needed - just share the sheet and set up triggers!