Last updated:

Power Automate: Start and prefill inspections with SharePoint items

Learn how to create a Power Automate flow to start and prefill inspections whenever an item is added on a SharePoint list.

Preparations

This is an advanced flow that requires the use of a start inspection request in JSON format. We recommend that you prepare the request body in a text editor such as Visual Studio Code, then copy and paste it into the flow accordingly. If you're unsure of how to build your request, check out this start_inspection.json sample as a reference. You can also review our API documentation for more information.

The easiest way to construct a request is by retrieving the information of an existing inspection that has answered the question items you want to prefill. Then copy the question items of interest and clear their responses to prepare for the SharePoint items in the Power Automate flow. If the questions you want to prefill are on the title page, then the request array should be "header_items". For all other inspection pages, the array should be "items".

Before you start building the flow, ensure you have an existing list in your organization's SharePoint site with columns created for each inspection question you want to prefill. This can be interchanged with other connectors such as Google Sheets and Microsoft Excel Online.

Please note that if you have the inspection title format set up for the template you want to use, questions that are prefilled and used to populate the inspection title won't take effect until the inspection is modified on the web app or the mobile app.

1. When an item is created

  1. Sign in to Power Automate.

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

  3. In the pop-up window, configure the following fields:

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

    • Choose your flow's trigger: Search and select When an item is created from SharePoint.

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

2. Initialize variable

  1. Click image below "When an item is created" and select Add an action.

  2. Search and select Initialize variable under the "Variable" connector.

  3. In the side panel, configure the following fields:

    • Name: Click the field and enter "Item Data".

    • Type: Click the field and select Object.

    • Value: Copy and paste in your start inspection request JSON. Then for each inspection response you want to prefill, click image and select the SharePoint list item from the list.

  4. You should see something that resembles the following example: Power Automate start inspection payload.

3. HTTP

  1. Click Plus iconNew step.

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

  3. Configure the following fields:

    • Method: Click the field and select POST.

    • URI: Click the field and enter "https://api.safetyculture.io/audits".

    • Headers (Enter key): Click the field and enter "Authorization".

    • Headers (Enter value): Click the field and enter your API token in the format of "Bearer [token]". Make sure there is a space between "Bearer" and the API token.

    • Body: Click the field and select Item Data from the dynamic content list.

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

Test the flow (optional)

  1. Make sure the flow is turned on.

  2. Create a new item on the SharePoint list you're using for the flow.

  3. If successful, a new inspection should be started using the template you selected and prefilled with information from the item you created.

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

Need more help?
In this article