Picking up where the Automatically export audits with MS Flow guide left off, we will extend the flow to automatically email each audit report via Outlook.
Add an action within the Apply to each loop and after the Download an audit report step. We will use Get a specific audit to retrieve data from within each audit to include in the email message.
Next, Office 365 Outlook’s Send an email action will be used. Add it immediately after Get a specific audit. Fill in the To field with the email address of whoever needs to receive the audit reports or even a group mailbox address.
Tip: Microsoft Flow provides conditional features and connectors for Office 365 Users and Groups which may be helpful for automatically determining the email recipients. The Microsoft Flow support team can provide further information.
This guide will configure the flow so that each email contains the name of the template an audit was completed from and the audit author’s name. To do that, click within the Subject field and then select both Template Name and Audit Author from the available dynamic content that appears. We have also manually typed some extra information into the Subject field.
Go ahead and do the same for the email body so that it includes additional information about the audit. This guide will display the Score, Total Score, Score Percentage, Date Started, Date Completed and Duration.
Note: Currently only audit metadata can be accessed. Additional audit data, such as individual item responses, may be made to be accessible by the iAuditor connector for Microsoft Flow in future versions.
The remaining step is to configure the Send an email action to include the audit report as an attachment. Click Show advanced options ⌄ to reveal more option fields.
You can use dynamic content to customise the filename of the attachment but the file extension (“.pdf” or “.docx”) must be manually typed in.
Finally, enter Audit Report from the dynamic content listed under Download an audit report, into the Attachments Content field.