Skip to main content

Power BI Custom Connector to for the ApprovalMax Public API

info

Check out the article ApprovalMax Power BI Connector on GitHub for more information.

Requirements

  • Visual Studio Code
  • Power Query SDK Extension for the VS Code (link) v0.2.3
  • Power Query/M Language Extension for the VS Code (link) v.0.1.53
  • Power BI Desktop

Step-by-step guideline

How to compile a connector

  1. Copy the repository from the official ApprovalMax GitHub:
https://github.com/ApprovalMax/approvalmax-microsoft-powerbi-connector.git
  1. Install all the pre-requisites and copy the files from the PBI_Connector folder into a new VS Code project.
  2. Create a new application in the ApprovalMax My Applications
    • Input https://oauth.powerbi.com/views/oauthredirect.html as the redirect URL
    • Copy your Client ID and Client Secret
  3. Open the cloned official repository and input your Client ID and Client Secret into the corresponding txt files. Replace the <YOUR_CLIENT_ID> and <YOUR_CLIENT_SECRET> placeholders without modifying the ID and Secret.
    • Client ID → client_id.txt
    • Client Secret → client_secret.txt
  4. Save the changes.
  5. In the VS Code, run a build task in order to compile the connector. This can be done via the menu (Terminal > Run Build Task) or via the shortcut (Ctrl + Shift + B). Then select the MakePQX option.

How to run a build task

  1. When these steps are completed, a .mez file would appear here:
PROJECTFOLDER\bin\AnyCPU\Debug\ApprovalMaxConnector.mez

This is the compiled connector.

How to set up Power BI to use a custom connector

The next steps follow the official guideline (link).

  1. If it does not yet exist, create a folder [Documents]/Power BI Desktop/Custom Connectors and put the compiled .mez file into it.
  2. Start your Power BI Desktop and allow custom connectors to be used by going to File > Options and Settings > Options > Security and selecting the option (Not Recommended) Allow any extension to load without validation or warning. Click on OK at the bottom and restart the Power BI Desktop.

Allow custom connectors in Security settings

  1. Once you restart, a connector-related warning window could pop up. Just click on OK.

Getting the data

  1. In Power BI go Home > Get data > More..., then find and select the ApprovalMaxConnector (Beta) from the list.

Find and select the custom connector

  1. In the appeared window, click on Sign-in button, which will redirect you to the login web page. Log in to your account and grant consent to the respective Organisations. Next, click on Continue. Finally, provide a link to the endpoint you want to use. Do refer to the article ApprovalMax Public API for more details about each API Method.
warning

Please note: In this step, you need to grant consent to requesting data from the selected Organisations. If you face any issues during this step, try to repeat it.

  1. If there is a connection already established, the connector will not ask you to log in again.
  2. Utilise the Power Query Syntax in order to load the data into the actual Power BI Workspace.

Power Query Editor