Last updated:

Power Automate: Export inspection data to Excel Online spreadsheets

Learn how to create a Power Automate flow to automatically export inspection data into an Excel Online spreadsheet.

As one of the most used spreadsheets applications, Microsoft Excel has established itself as a household name when it comes to data analysis. Offering a wide variety of functions, it's not only a place to store information but can also help people effortlessly analyze and visualize data. Using integration tools such as Power Automate (previously Microsoft Flow), you can automatically export your SafetyCulture inspection data to populate an Excel Online spreadsheet, so your team can access the latest information captured by your frontline users at any time and analyze the data with ease.

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

Take note

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: As inspection data differs between templates, you must filter by a specific template for this flow. Click the field to select the template from the list, 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. Filter array

  1. Click Add an action.

  2. Search for "Data Operations" and select the Filter array action.

  3. Configure the following fields:

    • Array to filter: Click the field and select Expression. Then enter the following expression. If the question response you want to export is in the title page, replace ['items'] with ['header_items'].

      body('Get_a_specific_inspection')['items'] An example of the filter array action in a Power Automate flow.

    • Choose a value (left): Click the field and select Expression. Then enter the following expression:

      item()['item_id']

    • Choose a value (right): Click the field and enter the unique identifier (item_id) of the question.

  4. You should see something that resembles the following example. We recommend that you click image on the upper-right of the action and "Rename" it to something you can refer back to as the question label, such as "Jobsite Hazard Check". An example of the filter array action in a Power Automate flow.

6. Compose

  1. Click Add an action.

  2. Search for "Data Operations" and select the Compose action.

  3. Click the field and select Expression. Then enter your expression based on the corresponding question's response type. You can copy and paste the samples we have for each response type. For example, if the response type is text answer, the following expression should be entered: body('Filter_array')?[0]?['responses']?['text']

  4. Please note that the 'Filter_array' in the sample refers to the label of the action in section "5. Filter array". If you followed our recommendation and renamed the action, you should match the expression with the new name. For example, if the filter array action was renamed to "Jobsite Hazard Check", the following expression should be entered with underscores (_) substituting spaces.

    body('Jobsite_Hazard_Check')?[0]?['responses']?['text']

  5. You should see something that resembles the following example. We recommend that you click image on the upper-right of the action and "Rename" it to something you can refer back to as the corresponding question's response, such as "Jobsite Hazard Check Response". An example of the compose action in a Power Automate flow.

  6. Repeat sections "5. Filter array" and "6. Compose" in combination, for each inspection question data you want to export.

7. Add a row into a table

  1. Click Add an action.

  2. Search for "Excel Online (Business)" or "Excel Online (OneDrive)" and select the Add a row into a table action.

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

  4. Configure the following fields:

    • Location: Click the field and select the spreadsheet's location.

    • Document Library: Click the field and select the spreadsheet's directory.

    • File: Click the folder icon on the right-hand side, then find and select the spreadsheet file.

    • Table: Click the field and select the table.

    • Column Name: The columns you formatted as a table in the Excel Online spreadsheet will appear as fields to populate. Click each field and select each "Compose" action's "Outputs" from the dynamic content list. An example of the add a row into a table action in a Power Automate flow.

  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?