<?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: Making API data sources work in power BI web in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Making-API-data-sources-work-in-power-BI-web/m-p/575515#M17762</link>
    <description>&lt;P&gt;I made a mistake, I passed underscore as parameter before, this is actual mistake I get:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;An error occurred in the ‘’ query. Expression.Error: We cannot convert a value of type Record to type Text.
Details:
    Value=Record
    Type=Type&lt;/PRE&gt;</description>
    <pubDate>Thu, 29 Nov 2018 14:06:14 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-11-29T14:06:14Z</dc:date>
    <item>
      <title>Making API data sources work in power BI web</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Making-API-data-sources-work-in-power-BI-web/m-p/575512#M17761</link>
      <description>&lt;P&gt;So I have a table with parameters for changing date ranges in API call.&lt;BR /&gt;I followed answers here and other resources and succesfully managed to gather data iteratively. Then I published my report in workplace and detected that it is not possible to refresh dataset. I googled again, stumbled upon reasons and solutions and tried to implement.&lt;BR /&gt;So I have upgraded my function-as-parameter so power BI web should be able to validate url:&lt;/P&gt;&lt;PRE&gt;let
    Source = (param as text) =&amp;gt;
let
    Source = Json.Document(Web.Contents("api_url_part",
    [
        RelativePath="api_url_part" &amp;amp; some_parameter &amp;amp; "api_url_part" &amp;amp; param,
        Query=
        [
            Headers=[Accept="application/json", Authorization="Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"]
        ]
    ]
)),
    by_date = Source[by_date],
    #"Converted to Table" = Record.ToTable(by_date),
    #"Expanded Value" = Table.ExpandRecordColumn(#"Converted to Table", "Value", {"session_count", "visitor_count", "desktop_visitors_count", "mobile_visitors_count", "tablet_visitors_count"}, {"session_count", "visitor_count", "desktop_visitors_count", "mobile_visitors_count", "tablet_visitors_count"})
in
    #"Expanded Value"
in
    Source&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;My other query that iterates API calls:&lt;/P&gt;&lt;PRE&gt;let
    step_1 = Date_params[date_param],
    step_2 = List.Transform (step_1, func_p()),
in
    step_3&lt;/PRE&gt;&lt;P&gt;Before I used Relative Path and Query everything worked on PowerBi desktop, only in web I had problems. Now when I run the second query I get this error message:&lt;/P&gt;&lt;PRE&gt;Expression.Error: 0 arguments were passed to a function which expects 1.
Details:
    Pattern=
    Arguments=List&lt;/PRE&gt;&lt;P&gt;If I enter parameter manually, first query is able to retrieve data so it means problem lies in and I need to change second query as well but I cannot figure out how.&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;</description>
      <pubDate>Thu, 29 Nov 2018 14:01:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Making-API-data-sources-work-in-power-BI-web/m-p/575512#M17761</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-29T14:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: Making API data sources work in power BI web</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Making-API-data-sources-work-in-power-BI-web/m-p/575515#M17762</link>
      <description>&lt;P&gt;I made a mistake, I passed underscore as parameter before, this is actual mistake I get:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;An error occurred in the ‘’ query. Expression.Error: We cannot convert a value of type Record to type Text.
Details:
    Value=Record
    Type=Type&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Nov 2018 14:06:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Making-API-data-sources-work-in-power-BI-web/m-p/575515#M17762</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-29T14:06:14Z</dc:date>
    </item>
  </channel>
</rss>

