Quick overview
This workflow monitors an Outlook inbox for project controlling Excel templates, pulls booked hours for the reporting month from a Promato SQL Server database, updates the template in OneDrive with actual person-days and cumulative values, and replies by email with the updated file and a deviation summary.
How it works
- Triggers every minute when an unread Outlook email arrives with an .xlsx attachment and derives the project key from the filename plus the reporting month from the subject (YYYY-MM) or the last completed month.
- Looks up matching Promato projects in Microsoft SQL Server, resolves the project selection (single project or combined set), and queries booked time entries for the reporting month.
- Aggregates Promato booked hours into person-days (hours/8) per person and month and stops with an error reply if no bookings are found.
- Uploads the Excel template to OneDrive and reads it via Microsoft Graph to detect the controlling sheet and its layout from labels (months, Plan/Ist rows, and optional totals sections).
- Matches Promato people to template rows, calculates plan-vs-actual deviations with a traffic-light status, and writes the actual values back into the correct cells while keeping existing formulas.
- If a "Kumulgrundlage" worksheet exists, updates or appends the cumulative month column in a single Microsoft Graph workbook session.
- Downloads the updated workbook, emails it back to the original sender with a formatted summary (including unmatched people and per-project actuals), marks the source email as read, and deletes the temporary OneDrive copy.
Setup
- Create Microsoft Outlook OAuth2 credentials with permission to read messages, download attachments, send replies, and mark messages as read.
- Create Microsoft OneDrive (Microsoft Graph) OAuth2 credentials with permission to upload, edit, download, and delete files in the target drive.
- Create Microsoft SQL Server credentials with read-only access to the Promato database and update the SQL queries to match your Promato schema, views, and column names.
- Ensure your Excel template follows the expected layout (month headers in German, Plan/Ist rows per person, a "Summe" section, and optionally a "Kumulgrundlage" sheet) and send it as an attachment named like Projektcontrolling_<Project>.xlsx.
- Configure the mailbox to monitor and adjust the polling interval if needed before activating the workflow.