<?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 Data Source is empty when I use Blank query with API in Report Server</title>
    <link>https://community.fabric.microsoft.com/t5/Report-Server/Data-Source-is-empty-when-I-use-Blank-query-with-API/m-p/3539283#M31834</link>
    <description>&lt;P&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;My API needs to iterate multiple times, so I updated the M code and got the output. However, when I try to refresh the dashboard in Power BI report server, the data source isn't enabled, and when I check the data source settings in Power BI desktop, it's empty. How can I schedule the dashboard?&lt;BR /&gt;&lt;BR /&gt;Below code is used in blank query.&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;let&lt;BR /&gt;// Define the function to fetch data from the API&lt;BR /&gt;GetData = (url) =&amp;gt;&lt;BR /&gt;let&lt;BR /&gt;// Make the API request&lt;BR /&gt;Source = Json.Document(Web.Contents(url)),&lt;BR /&gt;items = Source[items],&lt;BR /&gt;hasMore = Source[hasMore],&lt;BR /&gt;nextUrl = if hasMore then Source[links]{3}[href] else null,&lt;BR /&gt;itemsTable = Table.FromRecords(items)&lt;BR /&gt;in&lt;BR /&gt;[Items = itemsTable, HasMore = hasMore, NextUrl = nextUrl],&lt;/P&gt;&lt;P&gt;// Define the function to fetch data recursively&lt;BR /&gt;FetchDataRecursive = (url, accumulatedData) =&amp;gt;&lt;BR /&gt;let&lt;BR /&gt;// Fetch the next set of data&lt;BR /&gt;nextData = GetData(url),&lt;/P&gt;&lt;P&gt;// Update loop variables&lt;BR /&gt;newData = Table.Combine({accumulatedData, nextData[Items]}),&lt;BR /&gt;hasNextPage = nextData[HasMore],&lt;BR /&gt;nextUrl = nextData[NextUrl]&lt;BR /&gt;in&lt;BR /&gt;if hasNextPage &amp;lt;&amp;gt; false and nextUrl &amp;lt;&amp;gt; null then&lt;BR /&gt;@FetchDataRecursive(nextUrl, newData)&lt;BR /&gt;else&lt;BR /&gt;newData,&lt;/P&gt;&lt;P&gt;// Initial call to fetch data&lt;BR /&gt;apiUrl = "&lt;A href="https://au" target="_blank" rel="noopener"&gt;https://au&lt;/A&gt;.................................",&lt;BR /&gt;initialData = GetData(apiUrl),&lt;BR /&gt;finalData = FetchDataRecursive(initialData[NextUrl], initialData[Items])&lt;BR /&gt;in&lt;BR /&gt;finalData&lt;/P&gt;&lt;P&gt;---------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;Datasouce is empty&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 17 Nov 2023 14:47:07 GMT</pubDate>
    <dc:creator>Nikhil_D</dc:creator>
    <dc:date>2023-11-17T14:47:07Z</dc:date>
    <item>
      <title>Data Source is empty when I use Blank query with API</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Data-Source-is-empty-when-I-use-Blank-query-with-API/m-p/3539283#M31834</link>
      <description>&lt;P&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;My API needs to iterate multiple times, so I updated the M code and got the output. However, when I try to refresh the dashboard in Power BI report server, the data source isn't enabled, and when I check the data source settings in Power BI desktop, it's empty. How can I schedule the dashboard?&lt;BR /&gt;&lt;BR /&gt;Below code is used in blank query.&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;let&lt;BR /&gt;// Define the function to fetch data from the API&lt;BR /&gt;GetData = (url) =&amp;gt;&lt;BR /&gt;let&lt;BR /&gt;// Make the API request&lt;BR /&gt;Source = Json.Document(Web.Contents(url)),&lt;BR /&gt;items = Source[items],&lt;BR /&gt;hasMore = Source[hasMore],&lt;BR /&gt;nextUrl = if hasMore then Source[links]{3}[href] else null,&lt;BR /&gt;itemsTable = Table.FromRecords(items)&lt;BR /&gt;in&lt;BR /&gt;[Items = itemsTable, HasMore = hasMore, NextUrl = nextUrl],&lt;/P&gt;&lt;P&gt;// Define the function to fetch data recursively&lt;BR /&gt;FetchDataRecursive = (url, accumulatedData) =&amp;gt;&lt;BR /&gt;let&lt;BR /&gt;// Fetch the next set of data&lt;BR /&gt;nextData = GetData(url),&lt;/P&gt;&lt;P&gt;// Update loop variables&lt;BR /&gt;newData = Table.Combine({accumulatedData, nextData[Items]}),&lt;BR /&gt;hasNextPage = nextData[HasMore],&lt;BR /&gt;nextUrl = nextData[NextUrl]&lt;BR /&gt;in&lt;BR /&gt;if hasNextPage &amp;lt;&amp;gt; false and nextUrl &amp;lt;&amp;gt; null then&lt;BR /&gt;@FetchDataRecursive(nextUrl, newData)&lt;BR /&gt;else&lt;BR /&gt;newData,&lt;/P&gt;&lt;P&gt;// Initial call to fetch data&lt;BR /&gt;apiUrl = "&lt;A href="https://au" target="_blank" rel="noopener"&gt;https://au&lt;/A&gt;.................................",&lt;BR /&gt;initialData = GetData(apiUrl),&lt;BR /&gt;finalData = FetchDataRecursive(initialData[NextUrl], initialData[Items])&lt;BR /&gt;in&lt;BR /&gt;finalData&lt;/P&gt;&lt;P&gt;---------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;Datasouce is empty&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2023 14:47:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Data-Source-is-empty-when-I-use-Blank-query-with-API/m-p/3539283#M31834</guid>
      <dc:creator>Nikhil_D</dc:creator>
      <dc:date>2023-11-17T14:47:07Z</dc:date>
    </item>
  </channel>
</rss>

