Simpro To Power BI.
Posted: Sun Aug 10, 2025 10:36 pm
Hi,
Trying to connect simpro data to power Bi. I have gone through your documenation. I want to know whats the best way to do this. Below is an example power query snippet that i created. Am i heading in the right direction?
let
BaseUrl = "https://xxx.simprosuite.com",
CompanyID = "0",
Endpoint = "/api/v1.0/companies/" & CompanyID & "/jobs",
PageSize = 250,
AccessToken = GetAccessToken(),
GetPage = (page as number) =>
let
Response = Web.Contents(BaseUrl, [
RelativePath = Endpoint,
Query = [
page = Text.From(page),
pageSize = Text.From(PageSize)
],
Headers = [
Authorization = "Bearer " & AccessToken,
#"Content-Type" = "application/json"
]
]),
JsonResponse = Json.Document(Response),
Items = if Record.HasFields(JsonResponse, "items") then JsonResponse[items] else {}
in
Items,
AllPages = List.Generate(
() => [Page = 1, Data = GetPage(1)],
each List.Count([Data]) > 0,
each [Page = [Page] + 1, Data = GetPage([Page] + 1)],
each [Data]
),
Combined = List.Combine(AllPages),
ResultTable = Table.FromRecords(Combined)
in
ResultTable
I am able to retrieve the access token. But the result of this is an empty table with no data. Can someone help please?
Trying to connect simpro data to power Bi. I have gone through your documenation. I want to know whats the best way to do this. Below is an example power query snippet that i created. Am i heading in the right direction?
let
BaseUrl = "https://xxx.simprosuite.com",
CompanyID = "0",
Endpoint = "/api/v1.0/companies/" & CompanyID & "/jobs",
PageSize = 250,
AccessToken = GetAccessToken(),
GetPage = (page as number) =>
let
Response = Web.Contents(BaseUrl, [
RelativePath = Endpoint,
Query = [
page = Text.From(page),
pageSize = Text.From(PageSize)
],
Headers = [
Authorization = "Bearer " & AccessToken,
#"Content-Type" = "application/json"
]
]),
JsonResponse = Json.Document(Response),
Items = if Record.HasFields(JsonResponse, "items") then JsonResponse[items] else {}
in
Items,
AllPages = List.Generate(
() => [Page = 1, Data = GetPage(1)],
each List.Count([Data]) > 0,
each [Page = [Page] + 1, Data = GetPage([Page] + 1)],
each [Data]
),
Combined = List.Combine(AllPages),
ResultTable = Table.FromRecords(Combined)
in
ResultTable
I am able to retrieve the access token. But the result of this is an empty table with no data. Can someone help please?