Google Docs
Automate Google Docs document creation, editing, and management with Robomotion's comprehensive Google Docs integration.
Overview
The Google Docs package enables RPA developers to programmatically create, read, modify, and export Google Docs documents. This package is ideal for automating report generation, document workflows, template-based document creation, and batch document processing.
Key Features
- Document Management - Create new documents or open existing ones
- Content Manipulation - Insert, replace, and delete text with full formatting control
- Rich Formatting - Apply fonts, sizes, colors, alignment, bold, italic, and underline
- Structural Elements - Add headers, footers, headings, and links
- Media Integration - Insert images from URLs with size controls
- Export Capabilities - Export documents to PDF format
- Batch Operations - Process multiple documents in automation workflows
Authentication Methods
The package supports two authentication methods:
OAuth2 (Personal)
Best for personal Google Docs access. Requires one-time browser authorization.
Setup Steps:
- Open Google Cloud Console
- Enable Google Docs API
- Create OAuth 2.0 Client ID (Desktop app)
- Add
http://localhost:9876/oauth2/callbackto redirect URIs - Copy Client ID and Client Secret to credentials
Service Account
Best for server automation and shared drives. No browser interaction required.
Setup Steps:
- Open Google Cloud Console
- Enable Google Docs API
- Create Service Account and download JSON key
- Share documents with the service account email (found in JSON)
- Paste full JSON content into credentials
Common Use Cases
Report Generation
- Create formatted reports from data tables
- Generate invoices and receipts
- Build status reports and dashboards
Document Workflows
- Template-based document creation
- Batch document updates
- Automated document archiving
Content Management
- Update documentation programmatically
- Manage document headers/footers
- Standardize document formatting
Data Export
- Convert documents to PDF
- Export documents for distribution
- Archive documents automatically
Available Nodes
📄️ Add Footer
Robomotion.GoogleDocs.AddFooter
📄️ Add Header
Robomotion.GoogleDocs.AddHeader
📄️ Add Heading
Robomotion.GoogleDocs.AddHeading
📄️ Add Image
Robomotion.GoogleDocs.AddImage
📄️ Create Document
Robomotion.GoogleDocs.CreateDocument
📄️ Delete Range
Robomotion.GoogleDocs.DeleteRange
📄️ Insert Link
Robomotion.GoogleDocs.InsertLink
📄️ Insert Text
Robomotion.GoogleDocs.InsertText
📄️ Open Document
Robomotion.GoogleDocs.OpenDocs
📄️ PDF Export
Robomotion.GoogleDocs.PDFExport
📄️ Read Document
Robomotion.GoogleDocs.ReadDocument
📄️ Replace Text
Robomotion.GoogleDocs.ReplaceText
Best Practices
- Always open or create a document first - Use Open Document or Create Document before other operations
- Reuse Document IDs - Store and reuse document IDs to avoid repeated open operations
- Handle errors gracefully - Use Continue On Error for batch operations
- Use Service Accounts for automation - OAuth2 requires browser access, service accounts don't
- Share with service accounts - Remember to share documents with service account email
- Batch operations - Group multiple edits together for better performance
- Test formatting - Verify font names and sizes are supported by Google Docs
Typical Workflow
1. Create Document or Open Document
↓ (outputs document_id)
2. Add Heading / Insert Text / Add Image / etc.
↓ (uses document_id)
3. Add Header / Add Footer (optional)
↓ (uses document_id)
4. PDF Export (optional)
↓ (uses document_id)