Forum Discussion
Query contains unsupported function. Function name: Web.Contents for web API
my_bi_quest Wow! Your post opened my eyes with the problem with refreshing dataset from Web.Contents! 🙂
Earlier I had:
Web.Contents(BaseUrl, [RelativePath=RelativePath, Headers=Headers, Query=Query])
And the solution was only to change the first parameter to the string, not variable:
Web.Contents("https://xxxxxx.xxxxxx.net", [RelativePath=RelativePath, Headers=Headers, Query=Query])
Thank you very much!!! 😄
Anonymous Hoping someone can help! I have experienced same issues and was happy to see this post. Just altered my code to use a hardcoded first url and its still failing! My code is below, i am passing in a calcuated field called apiurl that is a concatenation of the remainder of the url and my variable.
Any help is appreciated! It refreshes in the desktop no problems but fails in the online service with error
"Query contains unsupported function. Function name: Web.Contents"
Web.Contents(
"https://lhca.teamwork.com/tasks/",
[
RelativePath=[apiurl]
]
)
- my_bi_quest6 years agoFrequent Visitor
Hi kleroy
You should remove the relative path "/tasks/" from your hardcoded URL. It should be https://lhca.teamwork.com instead.
Here an example for the Confluence API.
let
GetConfluContent = (id as number) =>
let
RawData = Web.Contents("https://yourcompanyname.atlassian.net",
[
RelativePath="wiki/rest/api/content/"&Text.From(id)&"?expand=children.attachment",
Headers=[Accept="application/json"]
]),
Json = Json.Document(RawData)
in Json
in GetConfluContent