<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Query contains unsupported function. Function name: Web.Contents for web API in Report Server</title>
    <link>https://community.fabric.microsoft.com/t5/Report-Server/Query-contains-unsupported-function-Function-name-Web-Contents/m-p/1213317#M14972</link>
    <description>&lt;P&gt;(subscription_id as text) as table=&amp;gt; let // Get an access token using the Client Credentials AccessToken = Json.Document(Web.Contents("TOKEN_URL", [ Headers=[Accept="application/json", ContentType="application/x-www-form-urlencoded"], Content=Text.ToBinary( "grant_type=client_credentials&amp;amp; client_id=XXX&amp;amp; client_secret=XXX&amp;amp; scope=XXX" ) ]))[access_token], body = "{ ""startDate"":""2010-01-01T00:00:00.000Z"", ""endDate"":""2030-12-01T00:00:00.000Z"", ""pageSize"":""100"" }", BuildQueryString = Uri.BuildQueryString(Parsed_JSON), // Call the target REST API, passing the access token as evidence of authorization Data = Json.Document(Web.Contents("URL/{subscriptionId}?subscriptionId=XXX", [ Headers=[Accept="application/json", #"Authorization"="Bearer " &amp;amp; AccessToken, #"Ocp-Apim-Subscription-Key"= "XXX", #"Content-Type"="application/x-www-form-urlencoded"], Content = Text.ToBinary(BuildQueryString), Query=[subscriptionId=subscription_id] ] )) in Data N.B: Don't forget to set the privacy level to Organisational in you data source settings otherwise refresh will fail from Power BI Service&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jul 2020 02:06:06 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-07-10T02:06:06Z</dc:date>
    <item>
      <title>Query contains unsupported function. Function name: Web.Contents for web API</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Query-contains-unsupported-function-Function-name-Web-Contents/m-p/887698#M12590</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have following code I am using to get data from WEB API, I am getting error when I tried to schedule refresh in Powerbi Service.&lt;/P&gt;&lt;P&gt;I am not sure what needs to be changed in code to get it work.&lt;/P&gt;&lt;P&gt;Error:&amp;nbsp;&lt;/P&gt;&lt;P&gt;"&lt;SPAN&gt;You can't schedule refresh for this dataset because the following data sources currently don't support refresh:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Data source for dtc_noWorkOrder&lt;/LI&gt;&lt;LI&gt;Data source for dtc_rejected&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://app.powerbi.com/" target="_blank" rel="noopener"&gt;Discover Data Sources&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Query contains unsupported function. Function name: Web.Contents"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;M Query:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;let&lt;BR /&gt;BaseUrl = "&lt;A href="https://forms.logiforms.com/api/1.0/form/371533/data" target="_blank" rel="noopener"&gt;https://forms.logiforms.com/api/1.0/form/371533/data&lt;/A&gt;?",&lt;BR /&gt;InfoUrl = "&lt;A href="https://forms.logiforms.com/api/1.0/form/371533/" target="_blank" rel="noopener"&gt;https://forms.logiforms.com/api/1.0/form/371533/&lt;/A&gt;",&lt;BR /&gt;Token = "YXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",&lt;BR /&gt;EntitiesPerPage = 100,&lt;BR /&gt;&lt;BR /&gt;GetJson = (Url) =&amp;gt;&lt;BR /&gt;let Options = [Headers=[Authorization = "Basic " &amp;amp; Token ]],&lt;BR /&gt;RawData = Web.Contents(Url, Options),&lt;BR /&gt;Json = Json.Document(RawData)&lt;BR /&gt;in Json,&lt;BR /&gt;&lt;BR /&gt;GetEntityCount = () =&amp;gt;&lt;BR /&gt;let Url = InfoUrl,&lt;BR /&gt;Json = GetJson(Url),&lt;BR /&gt;Count = Json[data][form][submissions]&lt;BR /&gt;in Count,&lt;BR /&gt;&lt;BR /&gt;GetPage = (Index) =&amp;gt;&lt;BR /&gt;let Skip = "page=" &amp;amp; Text.From(Index),&lt;BR /&gt;Url = BaseUrl &amp;amp; Skip,&lt;BR /&gt;Json = GetJson(Url),&lt;BR /&gt;Value = Json[data][records]&lt;BR /&gt;in Value,&lt;BR /&gt;&lt;BR /&gt;EntityCount = List.Max({ EntitiesPerPage, GetEntityCount() }),&lt;BR /&gt;PageCount = Number.RoundUp(EntityCount / EntitiesPerPage),&lt;BR /&gt;PageIndices = { 1 .. PageCount },&lt;BR /&gt;Pages = List.Transform(PageIndices, each GetPage(_)),&lt;BR /&gt;Entities = List.Union(Pages),&lt;BR /&gt;&lt;BR /&gt;#"Converted to Table" = Table.FromList(Entities, Splitter.SplitByNothing(), null, null, ExtraValues.Error),&lt;BR /&gt;#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"datesubmitted", "Timecard_RecordID", "lfuuid", "User_Name", "User_RecordID", "Rejection_Reason", "User_Functional_Area", "RecordID", "Rejection_Code"}, {"datesubmitted", "Timecard_RecordID", "lfuuid", "User_Name", "User_RecordID", "Rejection_Reason", "User_Functional_Area", "RecordID", "Rejection_Code"}),&lt;BR /&gt;#"Changed Type" = Table.TransformColumnTypes(#"Expanded Column1",{{"datesubmitted", type datetime}, {"Timecard_RecordID", Int64.Type}, {"lfuuid", type text}, {"User_Name", type text}, {"User_RecordID", Int64.Type}, {"Rejection_Reason", type text}, {"Rejection_Code", type text}, {"RecordID", Int64.Type}, {"User_Functional_Area", type text}}),&lt;BR /&gt;#"Reordered Columns" = Table.ReorderColumns(#"Changed Type",{"datesubmitted", "lfuuid", "RecordID", "Timecard_RecordID", "User_Name", "User_RecordID", "User_Functional_Area", "Rejection_Reason", "Rejection_Code"}),&lt;BR /&gt;#"Added Conditional Column" = Table.AddColumn(#"Reordered Columns", "Rejection_Description", each (&lt;BR /&gt;if [Rejection_Code] = "Z001" then&lt;BR /&gt;"Wrong Work Order"&lt;BR /&gt;else if [Rejection_Code] = "Z002" then&lt;BR /&gt;"Wrong Segment"&lt;BR /&gt;else if [Rejection_Code] = "Z003" then&lt;BR /&gt;"Time Not Approved"&lt;BR /&gt;else if [Rejection_Code] = "Z004" then&lt;BR /&gt;"Incorrect Day / Time"&lt;BR /&gt;else&lt;BR /&gt;""&lt;BR /&gt;))&lt;BR /&gt;in&lt;BR /&gt;#"Added Conditional Column"&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2020 08:11:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Query-contains-unsupported-function-Function-name-Web-Contents/m-p/887698#M12590</guid>
      <dc:creator>GURUPRASADB</dc:creator>
      <dc:date>2020-01-02T08:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: Query contains unsupported function. Function name: Web.Contents for web API</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Query-contains-unsupported-function-Function-name-Web-Contents/m-p/953665#M13261</link>
      <description>&lt;P&gt;I'm working a case with Microsoft about this very issue. The problem is certain calls can only be refreshed on the Power BI Service if the URL is hardcoded. Using an expression or variable, while allowed in Power BI Desktop while authoring, is rejected when you attempt to refresh or schedule the refresh.&lt;BR /&gt;&lt;BR /&gt;More information is in my original reply addressing this issue:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Service/Scheduled-Refresh-Query-contains-unsupported-function-Odbc/m-p/953664/highlight/true#M88887" target="_blank"&gt;https://community.powerbi.com/t5/Service/Scheduled-Refresh-Query-contains-unsupported-function-Odbc/m-p/953664/highlight/true#M88887&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Feb 2020 05:57:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Query-contains-unsupported-function-Function-name-Web-Contents/m-p/953665#M13261</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-29T05:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: Query contains unsupported function. Function name: Web.Contents for web API</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Query-contains-unsupported-function-Function-name-Web-Contents/m-p/1040271#M13950</link>
      <description>&lt;P&gt;Hi fellas,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I fixed this situation while breaking up the URL into parts thanks to this post :&lt;/P&gt;&lt;P&gt;&lt;A href="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/" target="_blank"&gt;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/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You basically need to hardcode the first part of your URL and continue with your variables for the rest of the implementation.&lt;/P&gt;&lt;P&gt;In my case it was a JIRA looping, hope the code below helps:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;let&lt;BR /&gt;JQL="yourJQL",&lt;BR /&gt;EntitiesPerPage = 50,&lt;BR /&gt;&lt;BR /&gt;EntityCount = List.Max({ EntitiesPerPage, GetEntityCount(JQL) }),&lt;BR /&gt;PageCount = Number.RoundUp(EntityCount / EntitiesPerPage),&lt;BR /&gt;PageIndices = { 0 .. PageCount - 1 },&lt;BR /&gt;Pages = List.Transform(PageIndices, each GetPageValues(_, EntitiesPerPage, JQL)),&lt;BR /&gt;Entities = List.Union(Pages),&lt;BR /&gt;#"Converted to Table" = Table.FromList(Entities, Splitter.SplitByNothing(), null, null, ExtraValues.Error),&lt;BR /&gt;#"Expanded {0}" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"key"}, {"Column1.key"})&lt;BR /&gt;in&lt;BR /&gt;#"Expanded {0}"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;###################################&lt;BR /&gt;&lt;BR /&gt;let&lt;BR /&gt;GetEntityCount = (JQL as text) =&amp;gt;&lt;BR /&gt;let&lt;BR /&gt;Json = GetJson(0, JQL),&lt;BR /&gt;Count = Json[total]&lt;BR /&gt;in Count&lt;BR /&gt;in GetEntityCount&lt;/P&gt;&lt;P&gt;####################################&lt;BR /&gt;&lt;BR /&gt;let&lt;BR /&gt;GetJson = (StartAt as number, JQL as text) =&amp;gt;&lt;BR /&gt;let&lt;BR /&gt;RawData = Web.Contents("&lt;A href="https://yourcompany.atlassian.net" target="_blank"&gt;https://yourcompany.atlassian.net&lt;/A&gt;",&lt;BR /&gt;[&lt;BR /&gt;RelativePath="rest/api/3/search",&lt;BR /&gt;Query=[&lt;BR /&gt;jql=JQL,&lt;BR /&gt;startAt=Text.From(StartAt)&lt;BR /&gt;],&lt;BR /&gt;Headers=[Accept="application/json"]&lt;BR /&gt;]),&lt;BR /&gt;Json = Json.Document(RawData)&lt;BR /&gt;in Json&lt;BR /&gt;in GetJson&lt;/P&gt;&lt;P&gt;####################################&lt;BR /&gt;&lt;BR /&gt;let&lt;BR /&gt;GetPageValues = (Index as number, EntitiesPerPage as number, JQL as text) =&amp;gt;&lt;BR /&gt;let&lt;BR /&gt;Json = GetJson((Index * EntitiesPerPage), JQL),&lt;BR /&gt;Value = Json[#"issues"]&lt;BR /&gt;in Value&lt;BR /&gt;in GetPageValues&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2020 20:49:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Query-contains-unsupported-function-Function-name-Web-Contents/m-p/1040271#M13950</guid>
      <dc:creator>my_bi_quest</dc:creator>
      <dc:date>2020-04-21T20:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: Query contains unsupported function. Function name: Web.Contents for web API</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Query-contains-unsupported-function-Function-name-Web-Contents/m-p/1126825#M14376</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/224720"&gt;@my_bi_quest&lt;/a&gt;&amp;nbsp;Wow! Your post opened my eyes with the problem with refreshing dataset from Web.Contents! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Earlier I had:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Web.Contents(BaseUrl, [RelativePath=RelativePath, Headers=Headers, Query=Query])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the solution was only to change the first parameter to the string, not variable:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Web.Contents("https://xxxxxx.xxxxxx.net", [RelativePath=RelativePath, Headers=Headers, Query=Query])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much!!! &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2020 14:24:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Query-contains-unsupported-function-Function-name-Web-Contents/m-p/1126825#M14376</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-05-28T14:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: Query contains unsupported function. Function name: Web.Contents for web API</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Query-contains-unsupported-function-Function-name-Web-Contents/m-p/1134430#M14419</link>
      <description>&lt;P&gt;@Anonymous&amp;nbsp;&amp;nbsp; 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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated! It refreshes in the desktop no problems but fails in the online service with error&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"Query contains unsupported function. Function name: Web.Contents"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Web.Contents(&lt;BR /&gt;"&lt;A href="https://lhca.teamwork.com/tasks/" target="_blank"&gt;https://lhca.teamwork.com/tasks/&lt;/A&gt;",&lt;BR /&gt;[&lt;BR /&gt;RelativePath=[apiurl]&lt;BR /&gt;]&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jun 2020 01:36:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Query-contains-unsupported-function-Function-name-Web-Contents/m-p/1134430#M14419</guid>
      <dc:creator>kleroy</dc:creator>
      <dc:date>2020-06-02T01:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: Query contains unsupported function. Function name: Web.Contents for web API</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Query-contains-unsupported-function-Function-name-Web-Contents/m-p/1134566#M14420</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/235255"&gt;@kleroy&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You should remove the relative path "/tasks/" from your hardcoded URL. It should be &lt;A href="https://lhca.teamwork.com" target="_blank"&gt;https://lhca.teamwork.com&lt;/A&gt; instead.&lt;/P&gt;&lt;P&gt;Here an example for the Confluence API.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;let&lt;BR /&gt;GetConfluContent = (id as number) =&amp;gt;&lt;BR /&gt;let&lt;BR /&gt;RawData = Web.Contents("&lt;A href="https://yourcompanyname.atlassian.net" target="_blank"&gt;https://yourcompanyname.atlassian.net&lt;/A&gt;",&lt;BR /&gt;[&lt;BR /&gt;RelativePath="wiki/rest/api/content/"&amp;amp;Text.From(id)&amp;amp;"?expand=children.attachment",&lt;BR /&gt;Headers=[Accept="application/json"]&lt;BR /&gt;]),&lt;BR /&gt;Json = Json.Document(RawData)&lt;BR /&gt;in Json&lt;BR /&gt;in GetConfluContent&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jun 2020 02:37:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Query-contains-unsupported-function-Function-name-Web-Contents/m-p/1134566#M14420</guid>
      <dc:creator>my_bi_quest</dc:creator>
      <dc:date>2020-06-02T02:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: Query contains unsupported function. Function name: Web.Contents for web API</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Query-contains-unsupported-function-Function-name-Web-Contents/m-p/1141893#M14472</link>
      <description>&lt;P&gt;This solution does not work for me&amp;nbsp;&lt;BR /&gt;My function is like that:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;(Param as text) =&amp;gt;&lt;/P&gt;&lt;P&gt;let&lt;BR /&gt;Source = Json.Document(Web.Contents(" MY URL " &amp;amp; ""&amp;amp;Param)),&lt;BR /&gt;#"Converted to Table" = ...,&lt;BR /&gt;#"Expanded Column1" = ...,&lt;BR /&gt;#"Renamed Columns"&amp;nbsp; = ...,&lt;BR /&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, I use am list of parameter, concatenated with API URL.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the sugestion for my case?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2020 12:55:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Query-contains-unsupported-function-Function-name-Web-Contents/m-p/1141893#M14472</guid>
      <dc:creator>osandrolucas</dc:creator>
      <dc:date>2020-06-04T12:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: Query contains unsupported function. Function name: Web.Contents for web API</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Query-contains-unsupported-function-Function-name-Web-Contents/m-p/1141954#M14473</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/173662"&gt;@osandrolucas&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You still using full URL in one string.&lt;/P&gt;&lt;P&gt;This is my function:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;(page as text) =&amp;gt;
  let
      RelativePath = "/Test/v3",
      Headers = [
        #"Subscription-Key" = SubscriptionKey
      ],

      Query = [
        from = Date.ToText(DateFrom, "dd/MM/yyyy"),
        to = Date.ToText(DateTo, "dd/MM/yyyy"),
        pageSize = Text.From(PageSize),
        page = Text.From(page)
      ],

      GetJson = (RelativePath, Headers, Query) =&amp;gt; 
        let RawData = Web.Contents("https://xxxx.xxxxx.net", [RelativePath=RelativePath, Headers=Headers, Query=Query]),
          Json = Json.Document(RawData)
        in Json,

      PageResult = GetJson(RelativePath, Headers, Query)
  in PageResult&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I will use "&lt;A href="https://xxxx.xxxx.net/Test/v3" target="_blank" rel="noopener"&gt;https://xxxx.xxxx.net/Test/v3&lt;/A&gt;" as a first parameter in Web.Contents it won't work &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2020 08:24:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Query-contains-unsupported-function-Function-name-Web-Contents/m-p/1141954#M14473</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-05T08:24:46Z</dc:date>
    </item>
    <item>
      <title>Re: Query contains unsupported function. Function name: Web.Contents for web API</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Query-contains-unsupported-function-Function-name-Web-Contents/m-p/1147329#M14504</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;Thanks for the support.&lt;BR /&gt;I tried make like that, but, does not works.&lt;/P&gt;&lt;P&gt;An example of call of my API is:&lt;/P&gt;&lt;P&gt;&lt;A href="http://folha-pagamento-facade-corporativo.agibank-prd.in/colaborador/demitidos/06-2020" target="_blank"&gt;http://folha-pagamento-facade-corporativo.agibank-prd.in/colaborador/demitidos/06-2020&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this case, the parameter is 06-2020 (month - year) and I need make that in a lot of months years&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Following your suggestion, I have this error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screenshot_2.jpg" style="width: 846px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/289872iFB5CBFBF1E6F2375/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot_2.jpg" alt="Screenshot_2.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I dont use Headers, because I dont have.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(page as text) =&amp;gt;
  let
      RelativePath = "colaborador/demitidos",

      Query = [
        Parametro
      ],

      GetJson = (RelativePath, Query) =&amp;gt; 
        let RawData = Web.Contents("http://folha-pagamento-facade-corporativo.agibank-prd.in", [RelativePath=RelativePath, Query=Query]),
          Json = Json.Document(RawData)
        in Json,

      PageResult = GetJson(RelativePath, Query)
  in PageResult&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Before that, my function was like that:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(Parametro as text) =&amp;gt; 

let
    Source = Json.Document(Web.Contents("http://folha-pagamento-facade-corporativo.agibank-prd.in/colaborador/demitidos/" &amp;amp; ""&amp;amp;Parametro)),
    #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"matricula", "nome", "dataDesligamento", "cpf", "localTrabalhoId", "motivoRescisao"}, {"Column1.matricula", "Column1.nome", "Column1.dataDesligamento", "Column1.cpf", "Column1.localTrabalhoId", "Column1.motivoRescisao"}),
    #"Renamed Columns" = Table.RenameColumns(#"Expanded Column1",{{"Column1.matricula", "matricula"}, {"Column1.nome", "nome"}, {"Column1.dataDesligamento", "dataDesligamento"}, {"Column1.cpf", "cpf"}, {"Column1.localTrabalhoId", "localTrabalhoId"}, {"Column1.motivoRescisao", "motivoRescisao"}}),
    #"Changed Type" = Table.TransformColumnTypes(#"Renamed Columns",{{"dataDesligamento", type date}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "key_colaborador", each Text.From([matricula]) &amp;amp; Text.From([dataDesligamento]))
in
    #"Added Custom"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But, this function returned that error: " Query contains unsupported function. Function name: Web.Contents " when I tried refresh automatic&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jun 2020 16:58:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Query-contains-unsupported-function-Function-name-Web-Contents/m-p/1147329#M14504</guid>
      <dc:creator>osandrolucas</dc:creator>
      <dc:date>2020-06-08T16:58:55Z</dc:date>
    </item>
    <item>
      <title>Re: Query contains unsupported function. Function name: Web.Contents for web API</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Query-contains-unsupported-function-Function-name-Web-Contents/m-p/1148313#M14515</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/173662"&gt;@osandrolucas&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looks that you should change your relative path.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I see that parameter "06-2020" is a part of your relative path.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the proper relative path should be:&lt;/P&gt;&lt;P&gt;RelativePath = "/colaborador/demitidos/06-2020",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In your function I see that you don't need "Query" part.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Query would be when you have additional parameters after "?" sign in your URL.&lt;/P&gt;&lt;P&gt;For example I have:&amp;nbsp;&amp;nbsp;&lt;A href="https://xxxx.xxxx.net/Test/v3" target="_blank" rel="noopener nofollow noopener noreferrer"&gt;https://xxxx.xxxx.net/Test/v3&lt;/A&gt;?page=2&amp;amp;pageSize=10000 (&amp;amp; all my parameters from the "Query")&lt;/P&gt;&lt;P&gt;And you don't have that:&amp;nbsp;&lt;A href="http://folha-pagamento-facade-corporativo.agibank-prd.in/colaborador/demitidos/06-2020" target="_blank" rel="nofollow noopener noreferrer"&gt;http://folha-pagamento-facade-corporativo.agibank-prd.in/colaborador/demitidos/06-2020&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jun 2020 07:59:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Query-contains-unsupported-function-Function-name-Web-Contents/m-p/1148313#M14515</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-09T07:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: Query contains unsupported function. Function name: Web.Contents for web API</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Query-contains-unsupported-function-Function-name-Web-Contents/m-p/1205001#M14917</link>
      <description>&lt;P&gt;Hi Everyone&amp;nbsp;@Anonymous&amp;nbsp;&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/188455"&gt;@GURUPRASADB&lt;/a&gt;&amp;nbsp; &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/173662"&gt;@osandrolucas&lt;/a&gt;&amp;nbsp; &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/235255"&gt;@kleroy&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/224720"&gt;@my_bi_quest&lt;/a&gt;&amp;nbsp;@&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I having the Same issue with the Oauth REST API. It is perfectly working in the Powe Bi desktop and refreshes as well. But when i Publish to the Bi server, A dataset is generated Automaticall and generating an error. The error is listed below.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;"You can't schedule refresh for this dataset because the following data sources currently don't support refresh:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Data source for Query1&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;A href="https://app.powerbi.com/" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;Discover Data Sources&lt;/STRONG&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://app.powerbi.com/" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;Query contains unsupported function. Function name: Web.Contents "&lt;/STRONG&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My M Query is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;let
    token_url = "https://api.example.com/v2/oauth/token",    

    //This is for Dynamic Date filter of last 2 day which i have used in api base url
    endDate = Date.From( DateTime.LocalNow() ),
    startDate = Date.AddDays( endDate , -2 ),
    startDateText = Date.ToText( startDate, "yyyy-MM-ddT01" ),
    endDateText = Date.ToText( endDate, "yyyy-MM-ddT23" ),
    api_base_url = "https://openapi.example.com/api/reporting-details/v2/prod/views/PurchaseOrders?realm=myrealm&amp;amp;filters=%7B%22createdDateFrom%22%3A%22"&amp;amp; startDateText &amp;amp;"%3A00%3A00Z%22%2C%22createdDateTo%22%3A%22"&amp;amp;endDateText&amp;amp;"%3A59%3A59Z%22%7D",
    qry_str = "?myparameter",

// Getting Oauth Access Token
   body="grant_type=openapi_2lo",
   Source  = Json.Document(Web.Contents(token_url,
   [ 
     Headers = [
       #"Content-Type"="application/x-www-form-urlencoded",
        #"Authorization"="Basic Tyuek938nrkdtoo439nrhyeojgwpddam2ie6gsd8wokf08ugdiwjjtAOp73hwusb"
       ],
     Content=Text.ToBinary(body)
   ])),
    token = Source[access_token],
// Oauth Token Section Ended


    // Getting Data From Api 
    data= Json.Document(Web.Contents(api_base_url&amp;amp;qry_str,
   [ 
     Headers = [
                #"Authorization"="Bearer "&amp;amp;token,
                #"Content-Type"="application/json",
                #"apiKey"="845RCEJTL63884jlkjaellT77kwnn"
                ]
     
   ])),
    Records = data[Records],
    #"Converted to Table" = Table.FromList(Records, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    //Alot of lines removed , Conversion to tabular form.
    in
    #"Renamed Columns"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have also replaced the url varibales with a string but i don't know what exactly the problem is. I am tired of this problem.&lt;/P&gt;&lt;P&gt;Any help will be really appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2020 02:36:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Query-contains-unsupported-function-Function-name-Web-Contents/m-p/1205001#M14917</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-07T02:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: Query contains unsupported function. Function name: Web.Contents for web API</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Query-contains-unsupported-function-Function-name-Web-Contents/m-p/1205128#M14918</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I took a quick look at your query and the problem is definitely on your second one.&lt;/P&gt;&lt;P&gt;Try breaking it like this and let me know if it worked:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"...&lt;/P&gt;&lt;P&gt;data= Json.Document(Web.Contents(&lt;A href="https://openapi.example.com/" target="_blank"&gt;https://openapi.example.com/&lt;/A&gt;,&lt;BR /&gt;[&lt;BR /&gt;RelativePath="api/reporting-details/v2/prod/views/PurchaseOrders?realm=myrealm&amp;amp;filters=%7B%22createdDateFrom%22%3A%22"&amp;amp; startDateText &amp;amp;"%3A00%3A00Z%22%2C%22createdDateTo%22%3A%22"&amp;amp;endDateText&amp;amp;"%3A59%3A59Z%22%7D"&amp;amp;qry_str,&lt;BR /&gt;Headers = [&lt;BR /&gt;#"Authorization"="Bearer "&amp;amp;token,&lt;BR /&gt;#"Content-Type"="application/json",&lt;BR /&gt;#"apiKey"="845RCEJTL63884jlkjaellT77kwnn"&lt;BR /&gt;]&lt;BR /&gt;])),&lt;/P&gt;&lt;P&gt;..."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The bottom idea with this issue is the the Power Bi service doesn't want anything dynamic on the main URL, that's why everything with parameters should go on the Relative Path or the Query sections.&lt;/P&gt;&lt;P&gt;You should always make a call to&amp;nbsp;Web.Contents with only the domain name as the first parameter and then break the rest of the URL within the others parameters of the function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope it helps!&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2020 03:33:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Query-contains-unsupported-function-Function-name-Web-Contents/m-p/1205128#M14918</guid>
      <dc:creator>my_bi_quest</dc:creator>
      <dc:date>2020-07-07T03:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: Query contains unsupported function. Function name: Web.Contents for web API</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Query-contains-unsupported-function-Function-name-Web-Contents/m-p/1213317#M14972</link>
      <description>&lt;P&gt;(subscription_id as text) as table=&amp;gt; let // Get an access token using the Client Credentials AccessToken = Json.Document(Web.Contents("TOKEN_URL", [ Headers=[Accept="application/json", ContentType="application/x-www-form-urlencoded"], Content=Text.ToBinary( "grant_type=client_credentials&amp;amp; client_id=XXX&amp;amp; client_secret=XXX&amp;amp; scope=XXX" ) ]))[access_token], body = "{ ""startDate"":""2010-01-01T00:00:00.000Z"", ""endDate"":""2030-12-01T00:00:00.000Z"", ""pageSize"":""100"" }", BuildQueryString = Uri.BuildQueryString(Parsed_JSON), // Call the target REST API, passing the access token as evidence of authorization Data = Json.Document(Web.Contents("URL/{subscriptionId}?subscriptionId=XXX", [ Headers=[Accept="application/json", #"Authorization"="Bearer " &amp;amp; AccessToken, #"Ocp-Apim-Subscription-Key"= "XXX", #"Content-Type"="application/x-www-form-urlencoded"], Content = Text.ToBinary(BuildQueryString), Query=[subscriptionId=subscription_id] ] )) in Data N.B: Don't forget to set the privacy level to Organisational in you data source settings otherwise refresh will fail from Power BI Service&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 02:06:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Query-contains-unsupported-function-Function-name-Web-Contents/m-p/1213317#M14972</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-10T02:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: Query contains unsupported function. Function name: Web.Contents for web API</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Query-contains-unsupported-function-Function-name-Web-Contents/m-p/1238580#M15156</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Good morning, I am having the same problem but when connecting to some DBF tables from different databases concatenated by a GetData, I understand that I would have to encode the DataSource in some way so that the power bi service recognizes it, but I do not understand how do it, any kind of help would be appreciated, I share the code of GetData and the one of the resulting table, thank you very much&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(Nlocal)=&amp;gt;
let
    Origen = Excel.Workbook(File.Contents("C:\Users\administrador.ESTANCIAS\Documents\Power BI Desktop\Sucursales.xlsx"), null, true),
    Sheet1_Sheet = Origen{[Item="Sheet1",Kind="Sheet"]}[Data],
    LOCAL = Sheet1_Sheet{Nlocal}[Column9],
    

    Source = OleDb.DataSource("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Z:\LINCEV3\"&amp;amp;LOCAL&amp;amp;"\DBF\;extended properties=dBASE IV",
    [Query="select CLCOD, CLTPO, CLNOM, CLDIR, CLLOC, CLCP, CLCUIT, CLVCODPAG, CLFECHA, CLFING, CLEMAIL from [cli.dbf]"])
in
    Source&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;let
    Source = Excel.Workbook (File.Contents ("C: \ Users \ administrator.STANCES \ Documents \ Power BI Desktop \ Branches.xlsx"), null, true),
    Sheet1_Sheet = Origin {[Item = "Sheet1", Kind = "Sheet"]} [Data],
    # "Promoted Headers1" = Table.PromoteHeaders (Sheet1_Sheet, [PromoteAllScalars = true]),
    # "Type changed" = Table.TransformColumnTypes (# "Promoted headers1", {{"LOCATION", type text}, {"GROUPING", type any}, {"LOCAL_NAME", type any}, {"LOCAL_NAME_TOTAL", type any}, {"COD_LOCAL", Int64.Type}, {"CONCEPT", type text}, {"SSS", type text}, {"TYPE", type text}, {"LOCAL", type text}, { "Active", Int64.Type}, {"Order", Int64.Type}}),
    # "Custom added" = Table.AddColumn (# "Type changed", "Custom", each GetDataCli ([COD_LOCAL])),
    # "Other columns removed" = Table.SelectColumns (# "Custom added", {"COD_LOCAL", "Custom"}),
    # "Custom expanded" = Table.ExpandTableColumn (# "Other columns removed", "Custom", {"CLCOD", "CLTPO", "CLNOM", "CLDIR", "CLLOC", "CLCP", "CLCUIT" , "CLVCODPAG", "CLFECHA", "CLFING", "CLEMAIL"}, {"CLCOD", "CLTPO", "CLNOM", "CLDIR", "CLLOC", "CLCUIT", "CLVCODPAG" , "CLFECHA", "CLFING", "CLEMAIL"}),
    # "Duplicates removed" = Table.Distinct (# "Custom expanded", {"CLCOD"})
in
    # "Duplicates removed"&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 21 Jul 2020 13:33:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Query-contains-unsupported-function-Function-name-Web-Contents/m-p/1238580#M15156</guid>
      <dc:creator>MatiasVizzari</dc:creator>
      <dc:date>2020-07-21T13:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: Query contains unsupported function. Function name: Web.Contents for web API</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Query-contains-unsupported-function-Function-name-Web-Contents/m-p/2960208#M27996</link>
      <description>&lt;P&gt;&lt;A href="https://excelguru.ca/power-query-errors-please-rebuild-this-data-combination/" target="_blank"&gt;https://excelguru.ca/power-query-errors-please-rebuild-this-data-combination/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Dec 2022 09:33:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Query-contains-unsupported-function-Function-name-Web-Contents/m-p/2960208#M27996</guid>
      <dc:creator>Element115</dc:creator>
      <dc:date>2022-12-10T09:33:09Z</dc:date>
    </item>
  </channel>
</rss>

