Connecting Power BI to Magpi
Magpi allows Enterprise users to forward their data to other applications. You can do three useful things this way:
- get response data from a specific form
- get a Magpi user's list of forms
- get a list of questions for a specific Magpi form
To request any of the three types of information above, you'll first create an access token in Magpi, and then enter some parameters into PowerBI. The entire process should take just a few minutes.
Click any image below to enlarge.
Creating an Access Token in Magpi
- Log into your Magpi Enterprise account
- Click on your username in the upper right corner of the screen, and choose Profile from the menu that will appear. This will bring you to your Profile page
- On the Profile page, click on the Integrations tab
- On the Integrations tab (see illustration below), you will see that the top section is for the Magpi API. Click the "Generate New Access Token" button.
- Copy the access token that was created.
The next step will take place in PowerBI, and will depend on which of the three types of data you wish to send to PowerBI (response data, a list of forms, or a list of questions). Most people will want to send the response data from a specific form, which is detailed in the first section below.
Option 1 - Get Response Data from a Specific Form (4 Steps)
Step 1 - collect the following information which you will enter into PowerBI:
Key Point |
Use version 2 if your specific form contains subforms. Otherwise, use version 1. |
add ampersand (&) at the end of the username |
add ampersand (&) at the end of the accesstoken |
Get the surveyID by opening the form in Magpi. Then look at the URL in your browser address bar. The surveyID is the long number in the URL. In this example, the surveyID is the highlighted portion (click image to enlarge): |
The date format should be the same one as the one on the data tab in Magpi |
The date format should be the same one as the one on the data tab in Magpi |
Step 2 - In Power BI Desktop, select Get Data > Web from the Home ribbon:
Step 3 - Choose the Advanced option, enter the parameters requested, and click Connect. Make sure the URL ends with a question mark (?), and the username and access token end in ampersand (&).
Step 4 - In the Navigator Window which appears, right-click on SurveyData and select Load to load your data into PowerBI:
2 - Get a Magpi User's List of Forms (4 Steps)
Step 1 - collect the following information which you will enter into PowerBI:
Key Points |
add ampersand (&) at the end of the username |
Step 2 - In Power BI Desktop, select Get Data > Web from the Home ribbon:
Step 3 - Choose the Advanced option, enter the parameters requested, and click Connect. Make sure the URL ends with a question mark (?), and the username ends in ampersand (&).
Step 4 - In the Navigator Window which appears, right-click on SurveyData and select Load to load your data into PowerBI:
3 - Get a List of Questions for a Specific Magpi Form (4 Steps)
This action gets a list of all questions for the specified form.
Step 1 - collect the following information which you will enter into PowerBI:
Parameters:
Key Point |
add ampersand (&) at the end of the username |
add ampersand (&) at the end of the accesstoken |
Get the surveyID by opening the form in Magpi. Then look at the URL in your browser address bar. The surveyID is the long number in the URL. In this example, the surveyID is the highlighted portion: |
Step 2 - In Power BI Desktop, select Get Data > Web from the Home ribbon:
Step 3 - Choose the Advanced option, enter the parameters requested, and click Connect. Make sure the URL ends with a question mark (?), and the username and accesstoken end in ampersand (&).
Step 4 - In the Navigator Window which appears, right-click on Question and select Load to load your form questions into PowerBI: