Goal:
Automatically read attachments (PDF or Excel) from incoming emails, extract Manager's Full Name and Sales Amount, and send this data to Google Sheets every 2 hours 15 minutes during working hours (09:00–18:00, Mon–Fri).
Technical Task
1. Source:
Gmail (subject: “Sales Report” or label Sales Reports).
Attachments: .pdf, .xlsx, .xls, .csv.
2. Processing:
Extract from the file:
Manager's Full Name
Sales Amount
If PDF — text or OCR.
If Excel — find columns Manager / Amount.
If the email does not have a manager → set the value “Unknown” or “0”.
If the email has a new manager not yet in the table → add as new, do not replace.
If the file specifies amounts by departments, they need to be summed up as a total amount.
3. Result:
Record in Google Sheets:
| Manager | Amount | Status |
4. Schedule:
Every 2 hours 15 minutes between 09:00–18:00:
09:00, 11:15, 13:30, 15:45, 18:00
5. Notifications:
A short message is sent to Telegram:
Report: {manager} — {amount} UAH
6. Tools:
7. Acceptance:
✅ Excel and PDF are processed
✅ New managers are added automatically
✅ If there is no manager — “0” is set
✅ Data from departments are summed
✅ No duplicates