Limble does not provide a formal integration with Power BI, but you can still connect your Microsoft Power BI desktop app with your Limble account to extract the data you need. This guide provides instructions to make a user-created integration for customers who have access to API and integrations in Limble.
Connect Microsoft Power BI Desktop to Limble
Once you generate Limble API Credentials, you’re ready to set up a Data Source in Power BI Desktop to use in exporting your Limble data for reporting use cases.
Create a Parameter for your Limble API Key
Open Power BI Desktop
Select the Home tab in the ribbon, then select Get Data > Blank Query. If you want to edit a Query you previously defined, Click Transform Data from the Home tab.
In the Power Query Editor, select Manage Parameters > New Parameter.
Configure the new parameter as follows:
Field | Value |
Name | Limble_API_Token |
Current Value | paste your Limble API Authorization Header value generated earlier. (See this guide). The value should follow the format of “Basic [BASE64 ENCODED YOUR_CLIENT_ID:YOUR_CLIENT_SECRET]” |
Select OK.
Right Click on the new Parameter in the left pane of the Power Query Editor, within the Queries section. Click Move to Group > New Group. Create a Group named “Limble API Data”. This group will hold related parameters and queries.
Create a Power Query to access your Limble Data
From within the Power Query Editor, click New Source > Other > Blank Query > Connect
Along the top editor bar, click Advanced Editor. Remove any default query text
Copy the text of the example Limble Query below, then paste within the Query Editor. The example shown here is for retrieving Limble Location data and parsing into table format:
let
// Define the URL endpoint
apiUrl = "https://api.limblecmms.com:443/v2/locations/?limit=100&page=1",
// Define the request headers (using your saved token)
headers = [
#"Authorization" = "Basic " & Limble_API_Token // LimbleAPI_Token is the parameter you have saved
],
// Make the GET request with the correct headers
response = Web.Contents(apiUrl, [
Headers = headers
]),
// Convert binary response to text to view the raw JSON
textResponse = Text.FromBinary(response),
// Parse the JSON text into a usable record
jsonResponse = Json.Document(textResponse),
// Convert the JSON response (list) to a table
locationsTable = Table.FromList(jsonResponse, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
// Expand the columns from the list of records
expandedTable = Table.ExpandRecordColumn(locationsTable, "Column1",
{"locationID", "name", "regionID", "timezone", "weeklyOperationHours", "address", "address2", "phone", "metaField1", "metaField2", "metaField3", "geoLocation", "workRequestPortal"},
{"Location ID", "Name", "Region ID", "Timezone", "Weekly Operation Hours", "Address", "Address 2", "Phone", "Meta Field 1", "Meta Field 2", "Meta Field 3", "GeoLocation", "Work Request Portal"})
in
expandedTableIn the ‘headers’ section of the Query, replace ‘Limble_API_Token’ with the name of the parameter you created earlier, if you used a different name. You can also adjust the request parameters in the ‘apiUrl’ string if needed. By default, the above example query will retrieve the first page of 100 locations in the Limble account. View the API documentation to see all available optional request parameters
When ready, click Done. If you don’t already see a table preview of the data, try clicking Refresh Preview. If you still see no data or encounter an error, you may have an incorrect Authorization parameter. Reach out to integrations@limble.com for support if this is the case.
In then left panel, right click the new Query and rename it to something useful, like ‘Limble Locations’. Move it to the group you created earlier for better organization.
From the top panel, click Data Source Settings > Edit Permissions. Credentials should be of type Anonymous and Privacy Level should be Public. Click OK and close the panel
Click Close & Apply.
View Your Limble Data in the Power BI Dashboard
At this point, you should return to the Home screen of Power BI Desktop. Along the left panel, select the top icon Report View. On the right, you should see the Query you created, eg “Limble Locations”. On the left panel, select the third icon Model View. In the main pane, you should see a table for the Query you just created, with all the columns listed.
You are now ready to use Power BI’s dashboard visualizations to create reports.
Aggregate Paginated Data
If you have many records of a particular type in your Limble data (eg: Assets, Parts), you may need to incorporate pagination to retrieve all records using the API, as a single request may not be able to reliably retrieve all records. To accommodate for this within you Power BI Desktop Query, follow the next guide.
Aggregate Paginated Limble Data from Power BI Dashboard
In the above guide, we walked through how to prepare a Power Query to call a Limble API and use the returned data to generate a table that can be used in reporting. Now, we will explore how to expand the Query structure to make repeated calls for paginated data of a particular endpoint. This allows us to collect all records into the same reporting table, even if there are too many to retrieve with a single API request.
Details of how the Limble API handles pagination can be found here. This guide will rely on the page and limit request parameters described there. As in the previous guide, we will use the example of retrieving a list of Limble Locations. The same process, though, can be applied to any Limble API endpoint.
Create a Function to be Used by the Query
From the Power BI Desktop Home page, click Transform Data > New Source > Other > Blank Query.
If you have a folder for storing Limble related Queries, you can move the new Query within it.
Rename the new Query to 'fnGetLimbleLocationsPage'. Then click Advanced Editor.
Paste the following code into the editor, replacing any default content
// Function: fnGetLimbleLocationsPage
// Purpose: Given a page number, returns a table of that page's data plus the row count
(pageNum as number) as record =>
let
// Base URL with the page query parameter inserted
apiUrl = "https://api.limblecmms.com:443/v2/locations/?limit=100&page=" & Number.ToText(pageNum),
// Define request headers, referencing your parameter
headers = [
Authorization = "Basic " & Limble_API_Token // e.g., "Basic ABC123..."
],
// GET request
response = Web.Contents(apiUrl, [ Headers = headers ]),
// Convert binary to text, then parse JSON
textResponse = Text.FromBinary(response),
jsonResponse = Json.Document(textResponse),
// Convert the JSON (list of records) to a table
locationsTable = Table.FromList(jsonResponse, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
// Expand columns
expandedTable = Table.ExpandRecordColumn(
locationsTable,
"Column1",
{
"locationID", "name", "regionID", "timezone", "weeklyOperationHours",
"address", "address2", "phone", "metaField1", "metaField2",
"metaField3", "geoLocation", "workRequestPortal"
},
{
"Location ID", "Name", "Region ID", "Timezone", "Weekly Operation Hours",
"Address", "Address 2", "Phone", "Meta Field 1", "Meta Field 2",
"Meta Field 3", "GeoLocation", "Work Request Portal"
}
),
// Count how many rows were returned on this page
rowCount = Table.RowCount(expandedTable),
// Return both the table and the count in a single record
output = [
Data = expandedTable,
Count = rowCount
]
in
outputBe sure to update ‘Limble_API_Token’ with your own Parameter name, if different. (Check the above linked guide for details on creating this) This function will take in a ‘pageNum’ argument as input, and will return the retrieved page of location data as well as a count of the records on that page. We can now create a Query that will use this function to repeatedly call the endpoint until a non-full page is returned. This will tell the Query that the final page has been reached, and the combined set of paged records can returned in table format. Let’s now create that Query.
Create a Query to Use the Function to Retrieve all Pages
Click Done within the function Advanced Editor panel. Click New Source and name the new Query ‘All Limble Locations’. Click Advanced Editor
Replace the default content with the following:
let
// Function reference (the custom function created above)
GetPage = fnGetLimbleLocationsPage,
// Generate a list of pages until the returned row count is less than 100
// 1. Initial: starts at page 1, "Finished" is false
// 2. Condition: keep going while "Finished" is false
// 3. Next: increment page +1; set "Finished" = true if rowCount < 100
// 4. Selector: produce the [Page] value in each iteration
Pages =
List.Generate(
() => [Page = 1, Finished = false],
each [Finished] = false,
each
let
currentPageData = GetPage([Page]),
rowCount = currentPageData[Count]
in
[
Page = [Page] + 1,
Finished = rowCount < 100
],
each [Page]
),
// For each page in Pages, call GetPage() again
// and retrieve only the "Data" (the table) from the record
TableList =
List.Transform(
Pages,
each GetPage(_)[Data]
),
// Combine all page-tables into one final table
FinalTable = Table.Combine(TableList)
in
FinalTableClick Done. Optionally, move the new Query to the same folder that contains your other Limble Queries.
If you don’t already see a table with data, try clicking Refresh Preview. If you still see no data or encounter an error, there may be a problem with your Authorization token. Reach out to integrations@limble.com for support
In this example, we used a limit of 100 within each API request. If you wish to adjust this, do so BOTH in the function ‘fnGetLimbleLocationsPage’ and the Query ‘All Limble Locations’. The limit value must match between these two entities.
View Your Limble Data in the Power
At this point, you should return to the Home screen of Power BI Desktop. Along the left panel, select the top icon Report View. On the right, you should see the Query you created, eg “All Limble Locations”. On the left panel, select the third icon Model View. In the main pane, you should see a table for the Query you just created, with all the columns listed.
You are now ready to use Power BI’s dashboard visualizations to create reports.