This guide will show you how to export inspection data from iAuditor so that you can automatically send it to any Spreadsheet (columns/rows), SQL database or CRM system supported by the Microsoft Flow ecosystem. In this example, we’ll be looking to add rows to a Spreadsheet based on a particular question, and it’s the response. Please read through our guide for how to find Audit Item IDs before proceeding with these steps.

Setup instructions

  1. To kick start your new blank Flow, begin by adding a “Schedule – Recurrence” trigger and set the interval as you wish. In this instance, we’re going to use 1 Hour as our frequency.
  2. We’ll also need to add a “Get past time” action
  3. Add this to your Flow and configure it to match the settings of the “Recurrence”
  4. The next step is to add the “Search modified inspections” action listed under iAuditor
  5. Once this is added, we’ll need to set the “Modified after field” to use “Get past time” action we created earlier. You’ll find this within the “Dynamic content” pop-out:
  6. Note: At this stage, you’ll be prompted to add your iAuditor API token. If you haven’t already set up authentication for the connector within Microsoft Flow, please see our how to get an iAuditor API token guide.
  7. An authentication prompt should appear; if this doesn’t automatically pop up, click the 3 dots in the top right of your action and select “Add new connection”

  8. Enter “iAuditor” as your “Connection Name”
  9. Within the “API Key” field, type “Bearer” followed by a whitespace and your API token.
  10. Your connection settings should look like this: (your token will replace the one shown)
  11. Click the “+” sign and select “Add an apply to each”
  12. Click the empty “Select an output from previous steps” field
  13. From the “Dynamic content” pop-out, select “Inspections” from our “Search modified Inspections” action
  14. This will apply any actions we created within the “Apply to each” to each inspection discovered at the search event
  15. Add a new action within the “Apply to each” and select “Get a specific inspection”
  16. Within the “Inspection ID” field, select “Inspection ID” from the “Dynamic content” pop-out
  17. Your “Get a specific inspection” reference should appear as below:
  18. In order to drill down into the body of the Inspection, we’ll now need to filter the inspections’ contents
  19. Add a new action and search “Filter array”. Locate the “Data Operations – Filter array” from the list of actions
  20. To easily identify the question you’re filtering by, we’ll want to rename our “Filter array”
  21. Click the 3 dots on the right hand side of the action and select “Rename”
  22. The text within the action will become highlighted. Enter an identifier for your question as below (it’s important to note here that symbols such as “?” aren’t supported so only include standard text).
  23. Our example here is the “Is the Car Clean?” question:
  24. We’ll now need to configure the properties of the filter to look at the body of the inspection and search for the particular “Item ID” (In this instance, a question within the inspection)
  25. *From – To define which area we’ll be specifically looking at, we’ll need to enter an expression to reference the results of the “Get a specific inspection” action and look at the ids within the inspection body.
  26. To enter an expression, click into the field and select “Expression” tab from the pop-out box.
  27. Type the below expression into the field: body(‘Get_a_specific_audit’)[‘items’]
  28. *If your expression fails, check the characters/symbols; you may need to re-type the apostrophes being used.
  29. Choose a Value – Here we’ll specify the attribute we’re going to be looking for; we’ll need another expression to specifically look at the Item ID: item()[‘item_id’]
  30. Given we’re looking for a specific item, set “Is equal to” for the condition. We can now go ahead and input the specific “Item ID” we’re looking for; in order to get this you will need to understand how to find the specific “Item ID”. We have a separate guide available on how to find Item IDs from your inspections or templates.
  31. With the “Item ID” now discovered, place it within the below field as below:
  32. So, now the item filter has been configured, we’ll need to discover the corresponding “selected” response within the Inspection.
  33. Add a new action, this time “Data Operation – Compose”
  34. Click into the “*Inputs” field. From the pop-out, select the “Expression” tab again and enter the below:
  35. body(‘Is_the_car_clean’)?[0]?[‘responses’]?[‘selected’]?[0]?[‘label’]
  36. Here we’re referencing the “Is the car clean?” “Filter array” we created earlier than looking at the first selected response.
  37. Our question and response have now been made available within the Flow, we can now use this to populate our Spreadsheet (in this case, Office 365)
  38. Head into Office & start a new workbook and create the column headers based off the question/item you’ve selected within your Flow
  39. Once your columns are set, select “Format as Table” from the menu bar and ensure “My table has headers” is ticked before selecting OK

  40. Your sheet should now look like this.
  41. In this example, we’ve included an additional column for the “Inspection ID” so we know which inspection the response has come from
  42. Return back to your Flow. We’ll now begin to map the items to the particular columns/rows within the Spreadsheet
  43. Add a new action and search for “Add a row into a table” (Business) as shown below:
  44. Once added, define the library, location, file and we’re referencing.
  45. After these are populated, you’ll see the columns within the sheet ready to map the response/inspection data to.
  46. Click into the “is the car clean?” column within the “Add a row into a table” action
  47. Within the “Dynamic content” pop-out locate the “Car Clean response” action we created earlier and click “See more”
  48. Click the “Output” once this is expanded

  49. Click into the “Inspection ID” column within the “Add a row into a table” action.
  50. Within the “Dynamic content” pop-out locate the “Get a specific inspection” action and find the “Inspection ID” entry.
  51. Your “Add a row into a table” action should now look like this:
  52. We’re now ready to run the Flow.
  53. Save, activate and run your Flow and watch the spreadsheet populate
  54. The Flow will continue to check every hour and add additional rows for any recently completed inspections
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!