<?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 REST API pull with pagination in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/REST-API-pull-with-pagination/m-p/1297091#M25258</link>
    <description>&lt;P&gt;I'm fairly new using APIs for building a Power BI report. I'm sure there is an easy way to do this, but I don't know how to proceed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a single pull from a REST API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Each page in the response is 1000 rows long. I need to figure out what type of Do/While loop to insert into the Advanced Editor so that it pulls 4 pages (my output is just over 3,000 rows).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just using pageIndex=1 and pageSize=1000 (hardcoded), after converting to a table inside the Advanced Editor, I get the text below. What should I insert into this so that I pull however many pages are required to get the full output?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in adance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;let&lt;BR /&gt;Source = Json.Document(Web.Contents("&lt;A href="https://api.connect.company.com/v1/retrieve?pageIndex=1&amp;amp;pageSize=1000" target="_blank"&gt;https://api.connect.company.com/v1/retrieve?pageIndex=1&amp;amp;pageSize=1000&lt;/A&gt;")),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Ignore),&lt;BR /&gt;#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"geography_name", "geography_id", "region_name", "module_id", "module_name", "time_period_formatted", "time_period", "value", "rating_name", "parent_rating_name"}, {"geography_name", "geography_id", "region_name", "module_id", "module_name", "time_period_formatted", "time_period", "value", "rating_name", "parent_rating_name"})&lt;BR /&gt;in&lt;BR /&gt;#"Expanded Column1"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 14 Aug 2020 18:01:13 GMT</pubDate>
    <dc:creator>paulmorgan</dc:creator>
    <dc:date>2020-08-14T18:01:13Z</dc:date>
    <item>
      <title>REST API pull with pagination</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/REST-API-pull-with-pagination/m-p/1297091#M25258</link>
      <description>&lt;P&gt;I'm fairly new using APIs for building a Power BI report. I'm sure there is an easy way to do this, but I don't know how to proceed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a single pull from a REST API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Each page in the response is 1000 rows long. I need to figure out what type of Do/While loop to insert into the Advanced Editor so that it pulls 4 pages (my output is just over 3,000 rows).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just using pageIndex=1 and pageSize=1000 (hardcoded), after converting to a table inside the Advanced Editor, I get the text below. What should I insert into this so that I pull however many pages are required to get the full output?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in adance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;let&lt;BR /&gt;Source = Json.Document(Web.Contents("&lt;A href="https://api.connect.company.com/v1/retrieve?pageIndex=1&amp;amp;pageSize=1000" target="_blank"&gt;https://api.connect.company.com/v1/retrieve?pageIndex=1&amp;amp;pageSize=1000&lt;/A&gt;")),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Ignore),&lt;BR /&gt;#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"geography_name", "geography_id", "region_name", "module_id", "module_name", "time_period_formatted", "time_period", "value", "rating_name", "parent_rating_name"}, {"geography_name", "geography_id", "region_name", "module_id", "module_name", "time_period_formatted", "time_period", "value", "rating_name", "parent_rating_name"})&lt;BR /&gt;in&lt;BR /&gt;#"Expanded Column1"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 18:01:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/REST-API-pull-with-pagination/m-p/1297091#M25258</guid>
      <dc:creator>paulmorgan</dc:creator>
      <dc:date>2020-08-14T18:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: REST API pull with pagination</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/REST-API-pull-with-pagination/m-p/1297565#M25267</link>
      <description>&lt;P&gt;Use a recursive function&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;getdata(offset,count)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then inside that function do your API call.&amp;nbsp; If the result (returned rows) is the same as the count, increase the offset by one and call the function again.&amp;nbsp; If it is less, pack up, and return the collected rows back to the calling process.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 23:53:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/REST-API-pull-with-pagination/m-p/1297565#M25267</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-08-14T23:53:06Z</dc:date>
    </item>
    <item>
      <title>Re: REST API pull with pagination</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/REST-API-pull-with-pagination/m-p/1300947#M25283</link>
      <description>&lt;P&gt;Thank you for taking the time to respond.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not that familiar with how to do what you suggest.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I will send this suggestion to someone in our development team and ask for assistance on how to implement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 12:15:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/REST-API-pull-with-pagination/m-p/1300947#M25283</guid>
      <dc:creator>paulmorgan</dc:creator>
      <dc:date>2020-08-17T12:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: REST API pull with pagination</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/REST-API-pull-with-pagination/m-p/1306394#M25337</link>
      <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/247201"&gt;@paulmorgan&lt;/a&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;You can take a look at the following document about the help functions about processing pagination api if it meet your requirement:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;A href="https://docs.microsoft.com/en-us/power-query/helperfunctions#tablegeneratebypage" target="_self"&gt;Helper Functions#tablegeneratebypage&lt;/A&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Regards,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Xiaoxin Sheng&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 07:08:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/REST-API-pull-with-pagination/m-p/1306394#M25337</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-19T07:08:18Z</dc:date>
    </item>
  </channel>
</rss>

