Forum Discussion
Data refresh in PowerBI Service
I believe you were in the right direction by looking at the blog of Chris Webb.
I found a solution to the Web.Contents method error here:
In short: you have to build a valid URL inside your Web.Contents method and then add the query parameters to it later, so that Power BI can do a static analysis on the URL.
I hope this helps.
Did I answer your question? Then please mark my post as a solution!
My blog: nickyvv.com
Thanks for your reply.
I am trying to work this out but I am stuck.
this is my code, can you see where it's going wrong?
each Json.Document(Web.Contents("https://testadmin.simplicate.nl/api/v2/hours/hours", [Query=[offset=Text.From([Counter]),limit=100], [Headers=[#"Authentication-Key"="auth-key-code", #"Authentication-Secret"="auth-secret-code"]]))
I get this error: Expression.SyntaxError: Invalid id.
when I try to use a number (for example 100) instead of Text.From([Counter]) it also doesn't work.
[Counter] contains a counter that gives back 100 rows each time as long as there are rows. This is to be found in my first post.
- Arendp6 years agoHelper III
I think the problem is, how to combine Query and Headers in 1 part of the web.contents function.
- Arendp6 years agoHelper III
Found it out already, it's all about putting the comma's and brackets at the right place 🙂
And numbers need to be converted to text.
This is my result:
each Json.Document(Web.Contents("https://testdemo.simplicate.nl/api/v2/hours/hours", [ Query=[offset=Text.From([Counter]),limit=Text.From(100)], Headers=[#"Authentication-Key"="auth-dey-code", #"Authentication-Secret"="auth-secret-code"] ] ))