Recently my Power BI dashboard has started to return an error and I'm not sure why. Can anyone explain why it might have failed?
The error I'm getting is:
The Advanced Query I'm using is:
let
url = "http://<domain>:<port>/jderest/orchestrator/SEF_ORCH_V4211APBISalesDash",
body = "{""deviceName"":""PowerBI"",""username"":""<username>"",""password"":""<password>""}",
Source = Json.Document(Web.Contents(url, [Headers=[ContentType="application/json"],Content = Text.ToBinary(body)]))
in
Source
I'm not sure what's wrong with it. I tried running it via Soup UI with the above and it worked.
Can anyone explain why the Advanced Query is erroring?
We found the solution. It looks like it stemmed from a newer update.
What was wrong is ContentType="application/json"
in the headers needed to have it's format updated. The correct format is #"Content-Type"="application/json"
.
So the original code:
let
url = "http://<domain>:<port>/jderest/orchestrator/SEF_ORCH_V4211APBISalesDash",
body = "{""deviceName"":""PowerBI"",""username"":""<username>"",""password"":""<password>""}",
Source = Json.Document(Web.Contents(url, [Headers=[ContentType="application/json"],Content = Text.ToBinary(body)]))
in
Source
Needed to be:
let
url = "http://<domain>:<port>/jderest/orchestrator/SEF_ORCH_V4211APBISalesDash",
body = "{""deviceName"":""PowerBI"",""username"":""<username>"",""password"":""<password>""}",
Source = Json.Document(Web.Contents(url, [Headers=[#"Content-Type"="application/json"],Content = Text.ToBinary(body)]))
in
Source
The reason for this is because after an update (not sure which one) ContentType="application/json"
was treated as a miscellaneous tag
With the change to #"Content-Type"="application/json"
It was no longer a miscellaneous tag. It is treated as an entity like before.