Forum Discussion
404 error when loading data to model
- 7 years ago
Yes, that's why I proposed it as a workaround ;)
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
SourceThanks 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 ;)
- seann7 years agoFrequent Visitor
Dropping the R code here for anyone who's facing the same dramas and has limited R skills like myself - credit to ImkeF and http://www.instantr.com/2012/12/11/exporting-a-dataset-from-r/
#"PREVIOUS STEP" = Whatever the last step was in M
#"Run R script" = R.Execute("write.csv(dataset, ""C:/Folder/File.csv"", row.names=F)",[dataset=#"PREVIOUS STEP"])
in
#"Run R script"