Last updated:

Power Automate: Upload inspection reports to SharePoint

Learn how to create a Power Automate flow to automatically upload inspection reports to SharePoint.

As one of the most used online collaboration platforms, Microsoft SharePoint has established itself as a great place to share and manage content to empower teamwork across an organization. Using integration tools such as Power Automate (previously Microsoft Flow), you can automatically export your SafetyCulture inspection reports to SharePoint, so your team always stays up to date on the latest information captured by your frontline users.

If your organization uses Zapier as the integration tool, you can create a Zap that delivers an equivalent solution.

Take note

  • This flow utilizes Microsoft SharePoint as the cloud solution to store inspection reports, it can be interchanged with other connectors such as OneDrive, Google Drive, and Dropbox.

  • Inspection reports that get uploaded are based on the inspections, which the account that generated the API token has access to. If you're an administrator, you can provide yourself inspection access or assign yourself the "data access" permission to have visibility over all inspections in your organization.

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

1. Recurrence

  1. Sign in to Power Automate.

  2. Click Create from the menu on the left-hand side and select Scheduled cloud flow.

  3. Configure the following fields:

    • Flow name: Add a name for your flow so you can refer back to it easily.

    • Starting: Set the date and time you want the flow to start running.

    • Repeat every: Set the frequency to 1 Hour.

  4. Click Create to create the flow and its first step.

2. Get past time

  1. Click Plus iconNew step.

  2. Search for "Date Time" and select the Get past time action.

  3. Set the "Interval" to 1 and leave the "Time unit" as Hour.

3. Search modified inspections

  1. Click Plus iconNew step.

  2. Search for "SafetyCulture" and select the Search modified inspections action.

  3. If this is your first time using SafetyCulture on Power Automate, authenticate the connector by configuring the following fields, then clicking Create.

    • Connection Name: We recommend that you name the connection by the account username or email from which the API token is generated.

    • API token: Input your API token in the format of "Bearer <token>". Make sure there is a space between "Bearer" and the API token.

  4. Configure the following fields:

    • Modified After: Click the field and select Past time from the dynamic content list.

    • Filter by template (optional): If you only want to process inspections from a specific template, click the field to select the template from the dropdown menu, or select Enter custom value and input the template's unique identifier.

    • Archived (optional): Click the field and select true if you want to only email reports of archived inspection, or select both for active and archived inspections.

    • Completed (optional): Click the field and select false if you want to only email reports of incomplete inspections, or select both for complete and incomplete inspections.

    • Ownership (optional): Click the field and select me if you want to only email reports of inspections that are owned by your account, or select other for inspections that are owned by other users in your organization.

    • Limit: Keep in mind that each flow run can only process up to 1,000 inspections. If your organization conducts more than 1,000 inspections every hour, you should narrow the frequency in "1. Recurrence" and "2. Get past time".

4. Get a specific inspection

  1. Click Plus iconNew step.

  2. Search for "SafetyCulture" and select the Get a specific inspection action.

  3. Click the "Audit ID" field and select Inspection Audit ID from the dynamic content list. This puts the action within an "Apply to each" action.

5. Export an inspection report

  1. Click Add an action.

  2. Search for "SafetyCulture" and select the Export an inspection report action.

  3. Configure the following fields:

    • Audit ID: Click the field and select Inspection Audit ID.

    • Format: Select to export your inspection reports as either PDF or Word files.

    • Preference ID (optional): Click the field and select the report layout you want to apply. Keep in mind that only report layouts for all templates are available.

6. Do until

  1. Click Add an action.

  2. Search for "Control" and select the Do until action.

  3. Skip the fields for now.

7. Check inspection export status

  1. Click Add an action within the "Do until" action.

  2. Search for "SafetyCulture" and select the Check inspection export status action.

  3. Configure the following fields:

    • Audit ID: Click the field and select Inspection Audit ID from the dynamic content list.

    • Export Task ID: Click the field and select Export Task ID from the dynamic content list.

  4. Return to "6. Do until" and configure the following fields:

    • Choose a value (left): Click the field and select Export status from the dynamic content list.

    • Choose a value (right): Type in "SUCCESS".

8. HTTP

  1. Click Add an action not within the "Do until" action, but below it.

  2. Search for "HTTP" and select the HTTP action.

  3. Configure the following fields:

    • Method: Click the field and select GET.

    • URI: Click the field and select Export URL from the dynamic content list.

9. Create file

  1. Click Add an action.

  2. Search for "SharePoint" and select the Create file action.

  3. If this is your first time using SharePoint on Power Automate, authenticate the connector by signing in to your SharePoint account.

  4. Configure the following fields:

    • Site Address: Click the field and select your SharePoint site.

    • Folder Path: Click the folder icon on the right-hand side and set your folder path to where inspection reports should be uploaded. As each SharePoint list, document library, or folder can only contain a maximum of 5000 items, we recommend that you use dynamic content items to sort your inspection reports into folders dynamically. You can check out the example below, where inspection reports are sorted by their template titles. Power Automate SharePoint create file.

    • File Name: Click the field and use dynamic content items to create a naming convention for inspection reports. Make sure to add ".pdf" or ".docx" at the end, depending on the report format you selected. For example, "<dynamic_content>.pdf".

    • File Content: Click the field and select Body from the dynamic content list, under "HTTP".

  5. Click Save on the bottom or upper-right of the page to save the flow.

Test the flow (optional)

  1. Click Test on the upper-right of the page to begin testing the flow.

  2. Select Manually and click Test.

  3. Click Run flow.

  4. Click Done to monitor the test flow.

Need more help?