<?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: Combine Rest API Pagination and Multiple Loops in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Combine-Rest-API-Pagination-and-Multiple-Loops/m-p/2383097#M34838</link>
    <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think&amp;nbsp;&lt;SPAN&gt;use function List.Generate in Power Query is a good way.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://gorilla.bi/power-query/list-generate-api-calls/" target="_self"&gt;How to use List.Generate to make API Calls in Power Query M&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Instead of pagination, you can also use List.Numbers along with Skip or Offset in the web calls to overcome the row limit.&amp;nbsp; This video walks through it.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=hHkU8tPhVXs&amp;amp;t=9s" target="_blank" rel="nofollow noopener noreferrer"&gt;Power BI - Tales From The Front - REST APIs - YouTube&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
    <pubDate>Wed, 09 Mar 2022 09:04:11 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-03-09T09:04:11Z</dc:date>
    <item>
      <title>Combine Rest API Pagination and Multiple Loops</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Combine-Rest-API-Pagination-and-Multiple-Loops/m-p/2373403#M34753</link>
      <description>&lt;P&gt;HI Everyone. I hope you all are having a wonderful day.&lt;BR /&gt;Background:&lt;BR /&gt;I want extract all data from Rest API but the issue is that its URL provides data of 50 rows &lt;STRONG&gt;per Agent-ID&lt;/STRONG&gt;.&lt;BR /&gt;URL:&amp;nbsp;&amp;nbsp;&lt;U&gt;&lt;A href="https://vcc-na8.8x8.com/api/stats/agents/" target="_blank" rel="noopener"&gt;https://vcc-na8.8x8.com/api/stats/agents/&lt;/A&gt;&lt;STRONG&gt;{Agent-ID}&lt;/STRONG&gt;/activities?n=1&lt;/U&gt;&lt;BR /&gt;So far I've been able to create a function in Power query which allows me to extract all the ID's,&lt;BR /&gt;PFB,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(id as text) as table=&amp;gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;let&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Source = Xml.Tables(&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Web.Contents( &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;"&lt;A href="https://vcc-na8.8x8.com" target="_blank" rel="noopener"&gt;https://vcc-na8.8x8.com&lt;/A&gt;",&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;[RelativePath=&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;"/api/stats/agents/"&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;amp;(id)&amp;amp;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;"/activities?n="]&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;in&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;source&lt;/STRONG&gt;&lt;BR /&gt;Than I invoked this function against the Agent id's column in new table and received al the id's with 50 rows.&lt;/P&gt;&lt;P&gt;Issue:&lt;BR /&gt;It provides 50 rows per ID. I need to do a pagination in above function so that it gives me all of the rows with these all Id's.&lt;/P&gt;&lt;P&gt;PFB the API documentation.&lt;BR /&gt;&lt;A href="https://bit.ly/3hBkoWE" target="_blank" rel="noopener"&gt;https://bit.ly/3hBkoWE&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Let me know if someone has the way to solve my problem.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 19:21:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Combine-Rest-API-Pagination-and-Multiple-Loops/m-p/2373403#M34753</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-03T19:21:56Z</dc:date>
    </item>
    <item>
      <title>Re: Combine Rest API Pagination and Multiple Loops</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Combine-Rest-API-Pagination-and-Multiple-Loops/m-p/2376020#M34776</link>
      <description>&lt;P&gt;Your function is missing the page number&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;(id as text,page as text) as table=&amp;gt;
let
Source = Xml.Tables(
Web.Contents(
"https://vcc-na8.8x8.com",
[RelativePath=
"/api/stats/agents/"
&amp;amp;(id)&amp;amp;
"/activities?n=" &amp;amp; page]
)
),

in
source&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 05 Mar 2022 02:15:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Combine-Rest-API-Pagination-and-Multiple-Loops/m-p/2376020#M34776</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2022-03-05T02:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: Combine Rest API Pagination and Multiple Loops</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Combine-Rest-API-Pagination-and-Multiple-Loops/m-p/2376038#M34778</link>
      <description>&lt;P&gt;Hi. Yes already tried the above function but it does not let me invoke the function. Instead shows error&lt;/P&gt;&lt;P&gt;.and also it does.nott work on blow query for pagination,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;= list.generate (()=&amp;gt;&lt;/P&gt;&lt;P&gt;[Output = try Factivity (1) otherwise null, n=1]&lt;/P&gt;&lt;P&gt;Each [output] &amp;lt;&amp;gt; null,&lt;/P&gt;&lt;P&gt;Each [output = try Factivity ([n]+50) otherwise null, n=[n]+50],&lt;/P&gt;&lt;P&gt;Each [output])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Mar 2022 02:54:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Combine-Rest-API-Pagination-and-Multiple-Loops/m-p/2376038#M34778</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-05T02:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: Combine Rest API Pagination and Multiple Loops</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Combine-Rest-API-Pagination-and-Multiple-Loops/m-p/2383097#M34838</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think&amp;nbsp;&lt;SPAN&gt;use function List.Generate in Power Query is a good way.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://gorilla.bi/power-query/list-generate-api-calls/" target="_self"&gt;How to use List.Generate to make API Calls in Power Query M&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Instead of pagination, you can also use List.Numbers along with Skip or Offset in the web calls to overcome the row limit.&amp;nbsp; This video walks through it.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=hHkU8tPhVXs&amp;amp;t=9s" target="_blank" rel="nofollow noopener noreferrer"&gt;Power BI - Tales From The Front - REST APIs - YouTube&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2022 09:04:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Combine-Rest-API-Pagination-and-Multiple-Loops/m-p/2383097#M34838</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-09T09:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: Combine Rest API Pagination and Multiple Loops</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Combine-Rest-API-Pagination-and-Multiple-Loops/m-p/2383252#M34845</link>
      <description>&lt;P&gt;I have tried list. generate finction but it does not provide values. Also I have watched the tales from front video but it requires count of the API rows which i don't have.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2022 10:14:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Combine-Rest-API-Pagination-and-Multiple-Loops/m-p/2383252#M34845</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-09T10:14:48Z</dc:date>
    </item>
    <item>
      <title>Re: Combine Rest API Pagination and Multiple Loops</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Combine-Rest-API-Pagination-and-Multiple-Loops/m-p/2383573#M34848</link>
      <description>&lt;P&gt;You can use List.Generate to peek into the response and see if at a given offset no more data is returned.&lt;/P&gt;
&lt;P&gt;You could also use recursive functions but these generally do not work well when you have to return a lot of data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As you may imagine - without access to your API it is very difficult to help you with the code. That's a problem for any scenario that requires authentication/authorization.&amp;nbsp; Pity that they don't have dummy/test user accounts.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2022 13:11:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Combine-Rest-API-Pagination-and-Multiple-Loops/m-p/2383573#M34848</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2022-03-09T13:11:33Z</dc:date>
    </item>
    <item>
      <title>Re: Combine Rest API Pagination and Multiple Loops</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Combine-Rest-API-Pagination-and-Multiple-Loops/m-p/2383594#M34849</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/100342"&gt;@lbendlin&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;PFB the summarized issue in the below link,&lt;BR /&gt;It has a video link through which you will be easily able to explain the the issue and provide solution.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;A href="https://community.powerbi.com/t5/Developer/Power-BI-Pagination-amp-Looping-using-List-Generate/m-p/2383290" target="_blank"&gt;https://community.powerbi.com/t5/Developer/Power-BI-Pagination-amp-Looping-using-List-Generate/m-p/2383290&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;Best,&lt;BR /&gt;Saad.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2022 13:23:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Combine-Rest-API-Pagination-and-Multiple-Loops/m-p/2383594#M34849</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-09T13:23:12Z</dc:date>
    </item>
  </channel>
</rss>

