Forum Discussion
adam_cogswell
9 years agoRegular Visitor
JSON query based on another query
Hi, New to PowerBI, and having what is probably a simple problem but can't seem to get it figured. I am trying to load JSON data and I've got one query working like a charm, transformed into a ta...
- 9 years ago
Sorry I ommitted a "let". See below:
let function = (ID as text) => let Source = Json.Document(Web.Contents("https://api.provider.com/survey_results?survey_id=" & ID, [Headers=[Authorization="Bearer ACCESS_TOKEN", Allow="application/json", #"NGIN-API-VERSION"="0.1"]])) in Source in function
adam_cogswell
9 years agoRegular Visitor
Hi,
Thanks for the reference information, and the M code. I was trying to use your code just to get more familiar with the language, but it's throwing a "Token EoF expected." error when I try to save it. Seems to dislike the two "in" statements at the end:
let
function = (ID as text) =>
Source = Json.Document(Web.Contents("https://api.provider.com/survey_results?survey_id=" & ID,
[Headers=[Authorization="Bearer ACCESS_TOKEN", Allow="application/json", #"NGIN-API-VERSION"="0.1"]]))
in
function
in
Sourcedkay84_PowerBI
9 years agoMicrosoft Employee
You switched the two "in" statements compared to my example
- adam_cogswell9 years agoRegular Visitor
Sorry, I had re-arranged them trying to troubleshoot it. It doesn't work either way...
- dkay84_PowerBI9 years agoMicrosoft Employee
To be clear, you are getting the error just trying to save the query/function, and not even at the point of invoking it, correct?
- adam_cogswell9 years agoRegular Visitor
Correct. I click "Done" and it shows that error. It also appears in the Advanced Editor before I even click the button.