<?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 Using Cursor Paginiation - Help required in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Using-Cursor-Paginiation-Help-required/m-p/881274#M21787</link>
    <description>&lt;P&gt;I have an API data source that returns 1 record and it uses cursor pagination. But I am new to Power BI and can't figure out how to do a response call to look up the next record and so on if more.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone assist, have tried multiple options but none seem to work&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="screenshot.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/219653i9AD48C5B5079D0DA/image-size/large?v=v2&amp;amp;px=999" role="button" title="screenshot.png" alt="screenshot.png" /&gt;&lt;/span&gt;&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>Fri, 20 Dec 2019 10:35:02 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-12-20T10:35:02Z</dc:date>
    <item>
      <title>Using Cursor Paginiation - Help required</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Using-Cursor-Paginiation-Help-required/m-p/881274#M21787</link>
      <description>&lt;P&gt;I have an API data source that returns 1 record and it uses cursor pagination. But I am new to Power BI and can't figure out how to do a response call to look up the next record and so on if more.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone assist, have tried multiple options but none seem to work&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="screenshot.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/219653i9AD48C5B5079D0DA/image-size/large?v=v2&amp;amp;px=999" role="button" title="screenshot.png" alt="screenshot.png" /&gt;&lt;/span&gt;&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>Fri, 20 Dec 2019 10:35:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Using-Cursor-Paginiation-Help-required/m-p/881274#M21787</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-20T10:35:02Z</dc:date>
    </item>
    <item>
      <title>Re: Using Cursor Paginiation - Help required</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Using-Cursor-Paginiation-Help-required/m-p/887764#M21880</link>
      <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;HI&amp;nbsp;@Anonymous&amp;nbsp;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;I think query paginated should suitable for your requirements. You can check at the following document or write a custom function with an iterator to merge each result and invoke web API with next cursor key:&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/handlingpaging" target="_self"&gt;Power query Handling Paging&lt;/A&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Sample:&lt;/FONT&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;let 
	GetListByCurrsor=(rootpath as text,apikey as text, size as number,optional _currsor as text, optional resultList as list) as list=&amp;gt;
	let
		Source=if 
                    _currsor&amp;lt;&amp;gt;null 
                then 
                    Json.Document(Web.Contents(rootpath&amp;amp;"&amp;amp;"&amp;amp;_currsor,[Header=[#"XXX-Api-Key"=apikey]])) 
                else 
                    Json.Document(Web.Contents(rootpath,[Header=[#"XXX-Api-Key"=apikey]])),
		Result=if 
                    resultList&amp;lt;&amp;gt; null 
               then 
                    if 
                        List.Count(resultList)&amp;lt;size 
                    then 
                        @GetListByCurrsor(rootpath,apikey,size,Source[currsor], List.Combine({resultList,Source[events]})) 
                    else
                        resultList
                else
                    @GetListByCurrsor(rootpath,apikey,size,Source[currsor],Source[events])
	in
		Result
in
	GetListByCurrsor&lt;/LI-CODE&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Comment: rootpath is API URL, apikey is the header optional parameter, size is the max size of the result, _cursor is cursor key, resultList is the list store and merge result.&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>Thu, 02 Jan 2020 09:10:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Using-Cursor-Paginiation-Help-required/m-p/887764#M21880</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-02T09:10:45Z</dc:date>
    </item>
  </channel>
</rss>

