Import Totango data into Power BI

Who can use this feature?

Leverage Totango API endpoints to retrieve segmented data directly from the Totango platform and bring that data into Microsoft Power BI.

Before you begin

These instructions assume the following:

  • You have a windows machine with administrative privileges
  • You have Power BI Desktop installed

1. Install Python

If you already have Python installed, you may skip this section.

  1. Download the latest version of Python:

    The download links are at the bottom (look for windows installer); choose which system type you have (64 bit or 32 bit). If you don’t know, you can check by going to Start > Settings > System > About, and look under system type.

  2. Once downloaded, right click on the installer and click on run as administrator. If prompted verify by clicking Yes.
  3. Select the option to Add Python 3.10 to PATH.
  4. Click on Customize installation.
  5. Clear all checkboxes except pip and py launcher, and then click Next.
  6. Leave the Advanced Options as is, and then click Install.
  7. Once done click Close.
  8. Reboot your machine.

2. Install packages

If you already have any of these packages installed, you may skip this section.

  1. Open the Command Prompt (click on the magnifying glass at the bottom left to search, and type in cmd).
  2. Type in the following within the Command Prompt:

    pip install pandas

    Press Enter and wait for it to complete.

    pip install matplotlib

    Press Enter and wait for it to complete.

    pip install requests

    Press Enter and wait for it to complete.

3. Import Totango data into PowerBI

This section requires you to modify a code snippet with the contents of an API endpoint and your Totango personal access token.

  1. Copy the code for from the git repository into a text editor on your computer.
  2. Within Totango, create a segment of the data you want to pull.
    • Modify filters to ensure only the accounts you want are in your data set.
    • Edit columns to add columns to the data set.
  3. From within the segment, click the Ellipses button > Generate API Endpoint
  4. Within the API Endpoint window, copy everything between 'query= and ' --header (just like in the image below). 

    Identifier data types and asc/desc clauses are not supported in the query string.

  5. Within your text editor with the code from github, paste what you just copied from Totango in place of {your_query}
  6. Obtain your Totango token (Edit Profile > Integrations). 
  7. Within your text editor, paste the token in place of <yourtokenhere>

    Be sure to leave the single quotes in place.

  8. Copy the entire code from the text editor.
  9. Within Power BI, go to Get Data > More...

  10. In the Get Data window, search for Python script. Select it, and click Connect.
  11. In the window paste the code, and click OK.
    This may take some time for the data to finish. If there are any issues, please reach out to Totango Support and provide the error message, the code you pasted, your token, and your query.

If you get an error that references the following:
NameError: name 'true' is not defined
NameError: name 'false' is not defined

Do a search and replace within the code for all instances of true with True (notice upper case). Do the same for false.

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request