Query Nintex Insights OData API using Microsoft PowerBI Desktop
If you want to analyze your workflow data for specific insights, you can design your workflows using beacon actions in the following Nintex capabilities:
- Nintex Automation Cloud
- Nintex for Office 365
- Nintex for SharePoint 2019
- Nintex for SharePoint 2016
- Nintex for SharePoint 2013
You can then use the Nintex Insights OData API to extract the data using Microsoft Power BI Desktop and create custom reports.
Step 1: Create a personal access token
Follow these steps to create the personal access token:
- On the upper-right of the Nintex Insights workspace home page, click Settings.
- Click Personal access token in the side navigation menu.
- In the Personal access token section, click Add token.
- Click Copy token and store the personal access token in a secure location.
- Click Close. The Personal access token is created and displayed in the list. The following details for the personal access token are displayed: Status, Created on, and Expires. The Add token button is disabled.
Caution: The personal access token cannot be viewed again after you close the dialog box. The personal access token is valid for one year.
Step 2: Copy the OData API URL
- On the upper-right of your Nintex Insights workspace home page, click Insights.
- Click Workflows in the side navigation menu.
- Search for or select and open the workflow for which you want to retrieve the OData API URL from the Workflows list.
- In the Workflow details section, click
OData. The Workflow OData dialog box displays the OData API URLs for the following endpoints.
Note: Only workflows with Beacon actions will display the OData button.
- Click Copy URL next to the respective fields to copy the required URL.
Step 3: Connect to the Nintex Insights OData API
Note: You must complete these steps the first time you use a Microsoft Power BI Desktop file to connect to the Nintex Insights OData API.
- Open a new file in Microsoft Power BI Desktop.
- Click Home > Transform data > Transform data.
- Click Home > Manage Parameters > New Parameter. The Parameters dialog box displays. Follow the steps below to add the WorkflowInstances parameter for retrieving data from the WorkflowInstances endpoint.
- Type WorkflowInstances in the Name field.
- Type WorkflowInstances in the Description field.
- Ensure the Required check box is selected.
- From the Type drop-down list, select Text.
- Type Test in the Current Value field.
- Click OK. The parameter you added is displayed under Queries in the left pane.
- Select WorkflowInstances on the left pane, and then click Home > Advanced Editor.
- In the Advanced Editor window, delete the displayed text and copy-paste the following lines:
- Replace <Personal access token> with the generated personal access token, which you have copied as described in Step 1: Create a personal access token.
- Replace <Nintex Insights OData API URL> with the URL that you have copied as described in Step 2: Copy the OData API URL.
- Click Done. If prompted, click Edit Credentials, select Anonymous access and click Connect. The data for the endpoint is retrieved and displayed. For more information about the columns, see the Properties tables in API Reference.
let
AccessTokenHeader = "Bearer <Personal access token>",
Headers = [Authorization=AccessTokenHeader],
Source = OData.Feed("<Nintex Insights OData API URL>", Headers)
in
Source
Tip: To retrieve data for the ProcessStages and ProcessBeacons endpoints, repeat Step 3 to Step 6.
- In the left pane under Queries, right-click WorkflowInstances and then click Properties.
- In the Query Properties dialog box, select the Enable load to report and Include in report refresh check boxes.
- Click OK.
- Click Save.
- To exit the Power Query editor and load data in the file, click Close & Apply > Close & Apply. The table data will be displayed under the Fields column on the right.
Tip: If data is not displayed, click Refresh. The data is not refreshed in real-time and it can take up to three hours to fetch the updated details.
- Click Save.
You can now use this file to configure relationships, add PivotTables, and explore other Microsoft Power BI options to customize and create the required reports. For more information, see Microsoft Power BI documentation.