Workflow
On the first of the month we have scheduled all Datto RMM reports to send with "Scheduled RMM Report: " followed by Autotask/Datto Company Name in subject. Recipient:
Info@nygeekgirls.com .
A PowerAutomate rule (RMMREPORTFIX1) processes the message, removes any periods from the customer name and saves the PDFs to a scratch folder at Geek Girls IT Team Site - Documents\client paper work, reports and proposals\scratch-DoNotDelete\[custnamenopunct]
PowerAutomate flow RMMREPORTFIX2 picks up the PDFS from the scratch folder and forwards them to ThinkAutomation (request@thinkauto.geekgirlsit.com) . It also renames the SP scratch folder to be named the current date and time so the name won't interfere with future rule processing.
ThinkAutomation processes PDFs into one PDF and adds a cover sheet. (A copy of the cover sheet template is attached to this article.) A mail merge adds the correct company name and date to the cover sheet.
The cover sheet (with mail merge fields) is saved on the local server under C:\Users\Administrator\Documents\Reports\[customer name]. The folder is named by ThinkAutomation and will always be named the 4th of the current month.
On the 5th
of the month, AT sends report with "AT Report: " followed by Autotask/Datto Company Name in subject. Recipient: request@thinkauto.geekgirlsit.com (ThinkAutomation). Info@geekgirlsit.com is cc-ed and a mailbox rule moves the email from info inbox to Reports/Autotask subfolder.
ThinkAutomation processes reports (removing blanks, saving PDFs) and schedules report to go out in either two more days (for reports with AT ticket attached) or three more days (for reports where no AT data qualified for the AT report).
When AT report is sent, TA creates one report from the multiple PDFs, using command line program PDFTK.
TA then sends the report to
reportupload@geekgirlsit.com. This triggers a PowerAutomate flow to upload the report to pre-existing client folder on SharePoint site.

NOTE SURE IF THIS APPLIES to PA. TA cannot create a SharePoint folder. Folder must already exist in order for report to be saved to SP site. The folder name must not have any periods in its name. Think Automation cannot handle SP uploads to folders with periods in the name. If the account name has any periods, TA is programmed to discard them when uploading to the folder. Other than periods, the company's account name should exactly match the company's folder name.

The file name and file path on the server must have no spaces in order for the concatenation utility to work, so TA removes the spaces during processing. However, the Sharepoint folder can have spaces.
If there is no AT report, ThinkAutomation looks in the SQL database for the names and email addresses to send just the Datto RMM report.
ThinkAutomation schedules the email of the reports to the email address indicated in the email body of the previously received AT report email (after 2 days on the 4th of the month) or to the email address(es) in the SQL database (after 3 days on the 5th of the month) which can be accessed using the dbeaver software on the TA server.
How to Fix It If the Reports Don't Go Out
The AT report processing depends on the RMM Reports folder being named the date one day before the current date (the "current date" being the AT report processing date). If the AT reports cannot be processed, on the 5th of the month rename each report folder so the name reflects the date one day before the date you want to re-process the AT report.
See also:
For more technical details on the TA triggers: