Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Good afternoon all
I am currently trying to format my M query so I can upload a report and the connected web link using the advanced section to contain the API Key will refresh. I managed to get this all working within Power BI but I am unable to format the M Query to work for relative path data this was my original code below:
I then attempted to update the code to use a relative path to make this possible update on Power BI Pro but with no luck:
When this runs it returns the API data, due to it being Paginated I run the following script to pull it into one table:
= List.Generate(()=>
[Result = try #"Proclaim Absences"(1) otherwise null, Page=1],
each [Result] <> null,
each [Result = try #"Proclaim Absences"([Page]+1) otherwise null, Page=[Page]+1],
each [Result])
Any assistance would be appreciated on how to get this working, it's a pain not being able to validate the API call in Power BI Data sets!
RelativePath is used if you need to add part of the url before the parameters (?). To add dynamic parameter use the Query option.
e.g.
Web.Contents("https://example.com",
[Query = [param1 = "1", param2 = "test"],
ApiKey = "X-API-KEY"
])
Note: As shown in the example above, it is recommended to not include key tokens in your power query, and instead use the ApiKey to indicate the name of the key parameter, and then use ApiKey authentication when you connect.
So the issue is I need the API Key within the M Query due to an auto refresh so you're suggesting I do the following:
Web.Contents("https://api.breathehr.com/v1/departments/104295/absences?per_page=100&page=",
[Query = [Param1 = Number.ToText(Page)]] , [Headers=[#"X-API-KEY"="prod-APIKeyHere"]])),
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
102 | |
53 | |
21 | |
12 | |
12 |