Monday, March 3, 2025
Extract File IDs from Google Drive URLs in Google Sheets
Description
This Google Apps Script allows you to automatically extract file IDs from Google Drive file URLs listed in a Google Sheet. The extracted file IDs are then populated into a separate column. This is useful when working with Drive file links and needing their unique identifiers for automation, API calls, or sharing purposes.
Instructions
1. Create a Google Sheet named `fileIdFromUrl`.
2. Populate the Sheet with the following columns:
- Column A (optional): ID (if needed for unique identifiers)
- Column B: File URLs (paste the Google Drive file links here)
- **Column C: File ID (this column will be filled by the script)
3. Add the Script
- Open your Google Sheet.
- Go to `Extensions > Apps Script`.
- Delete any existing code in the script editor.
- Paste the script below and save it.
4. Run the Script:
- Click the play button (▶️) in the Apps Script editor.
- The script will extract file IDs from the URLs and populate Column C.
Copy Code
Click the button below to copy the code easily:
```html
```
---
No comments:
Post a Comment