Power Automate (previously Microsoft Flow) offers a rich set of actions that you can use to automate your workflows with iAuditor, such as uploading inspection reports. However, you can take your integrations game to the next level by exporting data within inspections, specifically question responses, using Power Automate’s Workflow Definition Language, called expressions.

This article outlines some of the Power Automate expressions that you can use to export iAuditor inspection data. If you want to take a look at how the expressions work in action, check out our guides on creating flows automatically export inspection data to SharePoint lists and Excel Online.

Before you begin

When it comes to exporting inspection data on Power Automate, the “Filter array” and “Compose” actions are used in combination to export inspection questions' responses.

Please note that inspection data of questions that are within Repeat sections, or multiple-choice questions that have “multiple selection” enabled cannot be exported.

All expressions contain references to the names of actions you create in a flow, such as the expression “body('Get_a_specific_inspection')['items']” referencing the “Get a specific inspection” action. To ensure that your expressions can be easily created without issue, please avoid using the following symbols in your action names should you rename them:

  • Left angle bracket: <
  • Right angle bracket: >
  • Percent: %
  • Ampersand or and: &
  • Backslash: \
  • Forward slash: /
  • Question mark: ?

Filter array

The “Data Operations” connector’s “Filter” action is used to specify the question, of which its response data you wish to export.

As you may be creating several filter arrays to specify different questions' responses you wish to export, we recommend that you click the 3 dots 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”.

Array to filter

Click the “Array to filter” field, then copy and paste the following expressions accordingly, based on where the question is in the inspection:

  • Title Page
    body('Get_a_specific_inspection')['header_items']
  • All other inspection pages
    body('Get_a_specific_inspection')['items']

Choose a value

Click the “Choose a value” field, then copy and paste the following expressions accordingly, based on how you wish to filter for the question:

  • Filter by the unique identifier (recommended) with the question item ID as the corresponding value
    item()['item_id']
  • Filter by the label with the question label or name as the corresponding value
    item()['label']

Compose

The “Data Operations” connector’s “Compose” action is used to extract the response from the question item you specify in the “Filter array” action.

Please note that the ‘Filter_array’ in the samples below refers to the default name of the filter array action. 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 expression should replace ‘Filter_array’ with ‘Jobsite_Hazard_Check’, using underscores (_) to substitute spaces.

Inputs

Click the “Inputs” field, then copy and paste the following expressions accordingly, based on the question’s response type:

  • Multiple-choice (excluding multiple selection enabled questions)
    body('Filter_array')?[0]?['responses']?['selected']?[0]?['label']
  • Text answer (including Person, Document number, and Number responses)
    body('Filter_array')?[0]?['responses']?['text']
  • Date & Time (including Inspection date response)
    body('Filter_array')?[0]?['responses']?['datetime']
  • Location (including Inspection location)
    body('Filter_array')?[0]?['responses']?['location_text']
  • Checkbox and Slider
    body('Filter_array')?[0]?['responses']?['value']
  • Signature (name)
    body(’Filter_array’)?[0]?[‘responses']?['name']

Inputs - Sites

If your organization uses the Sites feature, the site of an inspection, as well as the site’s area and region can also be exported. As an exception, you don’t need to have a corresponding filter array action to extract the site name, site area, and site region.

Click the “Inputs” field, then copy and paste the following expressions accordingly:

  • Site name
    body('Get_a_specific_inspection')?['audit_data']?['site']?['name']
  • Site area
    body('Get_a_specific_inspection')?['audit_data']?['site']?['area']?['name']
  • Site region
    body('Get_a_specific_inspection')?['audit_data']?['site']?['region']?['name']
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!