It can be important for managers or supervisors to review inspection reports as soon as they are complete, and rather than relying on frontline inspectors to email them manually after completion, integration tools such as Power Automate (previously MS Flow) can automate the process for an organization. This not only takes out the potential for human error but also automates the workflow.

This article outlines the steps to instantly export and email inspection reports using Power Automate.

IMPORTANT NOTE

The new PDF and Word formats are not yet supported by the iAuditor connectors on Power Automate, you can find alternate automation solutions that are supported with the iAuditor Exporter or Zapier.

Requirements

  1. iAuditor Premium subscription
  2. iAuditor API Token
  3. Microsoft Office 365 user account
  4. Access to the Premium version of Power Automate

IMPORTANT NOTE

If you run into any errors or have any questions regarding the setup process, please contact our customer support team for assistance.

Steps to set up your flow

There are several ways a flow can be triggered to run, either from a designated event, manually, or on a recurrence set by the user. All, however, once triggered, flows follow a series of actions that flow into an output, such as uploading an inspection report into a cloud drive.

In this flow, the trigger is scheduled to reoccur every 1 hour, where all completed inspections within each hour passed are exported and downloaded, then automatically emailed to designated recipients via Microsoft Outlook.

Step 1: Recurrence

  1. Navigate to Power Automate and login to your Office 365 account.
  2. Click “Create” on the left-hand side and select “Scheduled flow”.
  3. Name your flow to help identify the automation moving forward.
  4. Configure the following:
    Starting: The date and time you want your first flow to start – set this accordingly.
    Repeat every: The interval you want the flow to run on – set this to “1 Hour”.
  5. Click “Create,” see that the first step is already created.
  6. Proceed with “+ New step.”

Step 2: Get past time

  1. Search and select the “Get past time - Date Time” action.
  2. Configure the following:
    Interval: Set this field to “1”.
    Time unit: Set this field to “Hour.”
  3. Proceed with “+ New step.”

Step 3: Search modified audits

  1. Search and select the “Search modified audits (preview) – iAuditor” action.
  2. Click the “Modified After” field and select “Past time” from the dynamic content list.
  3. (optional) If you wish to only export and email inspection reports from a particular template, click the “Filter by Template” field to select your template from the list or input the template_id.
    IMPORTANT NOTE

    A maximum of 1000 inspections can be processed during each interval. You will need to shorten the interval in step 1 and step 2 if your organization completes more than 1000 inspections per hour.

  4. Proceed with “+ New step.”

Authentication:

  1. If this is your first time using iAuditor on Power Automate, you will be prompted to authenticate the connector.
  2. Configure the following on authentication:
    Connection Name: We recommend naming by the username from which the API token is generated, so you can refer back easily should you need to set up multiple iAuditor connections.
    API Key: Input your API token in the format of “Bearer [token].” See our support article on how to generate an API token.
  3. Click “Create” to continue.

Step 4: Apply to each

  1. Search and select the “Apply to each - Control” action.
  2. Click on the “Select an output from previous steps” field and select “Audits” from the dynamic content list.
  3. Proceed with “Add an action” within the “Apply to each” window.

Step 5: Export an audit report

  1. Search and select the “Export an audit report (preview) - iAuditor” action.
  2. Configure the following:
    Audit ID: Click on the field and select “Audits Audit ID” from the dynamic content list.
    Format: Select from “pdf” and “docx” to determine the format of your report.
    Timezone (optional): Select from the list if you wish to apply a timezone other than UTC to your reports.
    Export Profile (optional): Select if you wish to apply an Export Profile.
  3. Proceed with “Add an action” within the “Apply to each” window.

Step 6: Do until

  1. Search and select the “Do until - Control” action.
  2. Skip the fields for now.
  3. Proceed with “Add an action” within the “Do until” window.

Step 7: Check the status of the export request submitted earlier

  1. Search and select the “Check the status of the export request submitted earlier (preview) - iAuditor” action.
  2. Configure the following:
    Audit ID: Click on the field and select “Audits Audit ID” from the dynamic content list.
    Export Task ID: Click on the field and select “Export Task ID” from the dynamic content list.
  3. Return to the fields in “Do until” and configure the following:
    Choose a value (left): Click on the field and select “Export Status” from the dynamic content list.
    Choose a value (right): Click on the field and type in SUCCESS.
  4. Proceed with “Add an action” within the “Apply to each” window, not within the “Do until” window.

Step 8: Download an audit report

  1. Search and select the “Download an audit report (preview) - iAuditor” action.
  2. Configure the following:
    Audit ID: Click on the field and select “Audits Audit ID” from the dynamic content list.
    Export Task ID: Click on the field and select “Export Task ID” from the dynamic content list.
    Audit Report Filename: Click on the field and select “Filename” from the dynamic content list.
  3. Proceed with “Add an action” within the “Apply to each” window.

Step 9: Get a specific audit

  1. Search and select the “Get a specific audit (preview) - iAuditor” action.
  2. Click on the “Audit ID” field and select “Audits Audit ID” from the dynamic content list.
  3. Proceed with “Add an action” within the “Apply to each” window.

Step 10: Send an email (V2)

  1. Search and select the “Send an email (V2) - Office 365 Outlook” action.
  2. If this is your first time using Office 365 Outlook on Power Automate, you will be prompted to authenticate the connector.
  3. Configure the following:
    To: Input with the email address(es) or email group(s) of recipients.
    Subject: Input with the subject you wish to set for the email.
    Body: Input the body of the email.
  4. Click “Show advanced options” and configure the following:
    Attachments Name - 1: Set the naming convention of your report attachment filename, followed by the .pdf or .docx accordingly.
    Attachments Content - 1: Click and select “Audit Report” from the dynamic content list.
    IMPORTANT NOTE

    Dynamic content items can be useful if you wish to automatically compose emails with inspection details dynamically. Please see the example below for reference.


  5. Click “Save” on the top right corner of the page to turn on your flow.
  6. Optional: Continue to the section below if you wish to test your flow.

Testing:

  1. Make sure you have at least one inspection completed within the past time interval set in step 2, if a template filter was set, make sure the inspection completed is from that template.
  2. Click “Test” on the top right corner of the flow edit page.
  3. Choose “I’ll perform the trigger action” and click “Test.”
  4. Confirm the test by selecting “Run flow.”
  5. The flow starts running, and recipients should begin receiving emails with inspection reports attached.
Was this article helpful?

We love your feedback. Please tell us what you think.


Yes No
Care to share a bit more so we can continue to make improvements for you? Care to share a bit more so we can make this article even better for you? Thanks for your feedback!