Forum Discussion
404 error when loading data to model
- 7 years ago
Yes, that's why I proposed it as a workaround ;)
HI seann,
Unfortunately, I also not found effective solutions to work through this issue. Maybe you can take a look at following blog about handling special characters.
Handling special characters from html files with Power BI (M language).
ImkeF Any suggestion with web connector and character encode?
Regards,
Xiaoxin Sheng
Sorry, this looks like a bug to me: You clearly have the correct strings in your URL and it loads correctly in the editor and when transforming to the model it does an extra conversion. You should file a bug-report for it.
Theoretically one could enforce the string-evaluation by using "Expression.Evaluate", but unfortunately this doesn't work when loading to the model as well (but this is by design).
So the only workaround I can think of at the moment is to run the query in the editor and use an R- or Python-script to export from the editor to a csv-file and re-import from there.
- ImkeF7 years agoCommunity Champion
Actually, another idea:
Try the "Relative Path"-method: https://blog.crossjoin.co.uk/2016/08/16/using-the-relativepath-and-query-options-with-web-contents-in-power-query-and-power-bi-m-code/
With any luck, this bypasses the problem:
let Encoded = Uri.EscapeDataString("/"), Source = Json.Document(Web.Contents("https://[DOMAIN]/[PATH]",
RelativePath="user?[QUERY]",
Query=[Headers=[Authorization="[AUTHKEY]"]])) in Source- seann7 years agoFrequent Visitor
Thanks for the workaround ImkeF. Unfortunately the "RelativePath" function seems to be a placeholder for "/", rather than the encoded "%2f" so I'm encountering the same 404 error. I'll file a bug report.
Can an R/Python script access the data in the query editor without it being loaded to model?
- ImkeF7 years agoCommunity Champion
Yes, that's why I proposed it as a workaround ;)