How to do Pagination on a REST API in Power Query (Part 1)

Поділитися
Вставка
  • Опубліковано 31 лип 2024
  • In today's video, I am going to show you how to implement pagination when the number of pages or records to be returned are known.
    Chapters:
    00:00 Intro
    00:30 Not all APIs have the same structure
    01:10 Get data from World Bank API
    01:45 How pagination works on the API
    02:30 Hardcode the number of pages
    04:50 Dynamically feed the number of pages
    06:06 Explain List.Numbers
    08:20 Unknow number of records?
    Done!
    Here you can download the power bi file used in the video:
    Go to:curbal.com/donwload-center
    Click on community downloads and
    Get download number 67.
    World bank api: datahelpdesk.worldbank.org/kn...
    List.Numbers: docs.microsoft.com/en-us/powe...
    Here you can download all the pbix files: curbal.com/donwload-center
    SUBSCRIBE to learn more about Power and Excel BI!
    / @curbalen
    Our PLAYLISTS:
    - Join our DAX Fridays! Series: goo.gl/FtUWUX
    - Power BI dashboards for beginners: goo.gl/9YzyDP
    - Power BI Tips & Tricks: goo.gl/H6kUbP
    - Power Bi and Google Analytics: goo.gl/ZNsY8l
    ☼☼☼☼☼☼☼☼☼☼
    POWER BI COURSES:
    Want to learn Power BI? How about you take one of our courses? Here you can find the available courses:
    curbal.com/courses-overview
    ☼☼☼☼☼☼☼☼☼☼
    ABOUT CURBAL:
    Website: www.curbal.com
    Contact us: www.curbal.com/contact
    ▼▼▼▼▼▼▼▼▼▼
    If you feel that any of the videos, downloads, blog posts that I have created have been useful to you and you want to help me keep on going, here you can do a small donation to support my work and keep the channel running:
    curbal.com/product/sponsor-me
    Many thanks in advance!
    ▲▲▲▲▲▲▲▲▲▲
    ************
    ************
    QUESTIONS? COMMENTS? SUGGESTIONS? You’ll find me here:
    Linkedin ► goo.gl/3VW6Ky
    Twitter ► @curbalen, @ruthpozuelo
    Facebook ► goo.gl/bME2sB
    #CURBAL #SUBSCRIBE

КОМЕНТАРІ • 100

  • @CurbalEN
    @CurbalEN  Рік тому +4

    If you dont know the number of pages, use this method:
    ua-cam.com/video/05yhwnuCjRw/v-deo.html&ab_channel=Curbal

  • @user-fm3xv9jx6l
    @user-fm3xv9jx6l 4 місяці тому +1

    Thank you Corbal. This worked wonderfully for an api call that has variable number of pages (10-100).

  • @HachiAdachi
    @HachiAdachi 2 роки тому +7

    Voting for sooner Part 2! Thanks, Ruth!

    • @CurbalEN
      @CurbalEN  2 роки тому

      Sooner will be :)

    • @TUBBBBB1
      @TUBBBBB1 2 роки тому

      Applying as well, trying to figure this problem out as we speak

    • @CurbalEN
      @CurbalEN  2 роки тому +1

      It is out already:
      m.ua-cam.com/video/05yhwnuCjRw/v-deo.html

  • @EverythingPants
    @EverythingPants 2 роки тому +1

    I've been wondering how to do this for ages, this is amazing. I've implemented it today for a client and it's worked perfectly - Thanks!

  • @nelsoneng208
    @nelsoneng208 Рік тому

    Wanted to drop a line and say thank you! Can't tell you how much help this was. Thank you again!

  • @leonelcontreras-t598
    @leonelcontreras-t598 Рік тому

    excellent video, knowing how to get information from api is really a great help. This video deserves so much more likes.

  • @skalsolutions
    @skalsolutions 2 роки тому +1

    As always, a great video with good content! Waiting for the second video! :)

    • @CurbalEN
      @CurbalEN  2 роки тому

      I hear you guys, will do it maybe next week already

  • @seandavies99
    @seandavies99 2 роки тому

    Thank you so much ! Exactly what I needed !

  • @melissaclaassen9707
    @melissaclaassen9707 2 роки тому

    Thank you so much! I just got dropped into the deep end of the reporting pool at work, and this was an exceptionally helpful video!

  • @prabhakaran7406
    @prabhakaran7406 2 роки тому

    Thank you so much, wonderful explanation !!

  • @CeliaAlvesSolveExcel
    @CeliaAlvesSolveExcel 2 роки тому +3

    Love this! Making everything dynamic is exciting!

  • @lordmarioh
    @lordmarioh 2 роки тому

    This video is a lifesaver! Thank you so much!!!

  • @fajnefajne4339
    @fajnefajne4339 2 роки тому

    This video is very luxurious. Thank you very much. :-)

  • @olenadumna4206
    @olenadumna4206 Рік тому

    thank you for this video! very good explanation !

  • @markgoode9897
    @markgoode9897 2 роки тому +2

    Yes please Ruth. Would love to see that second video. Thanks for sharing :) Great practical topic

    • @CurbalEN
      @CurbalEN  2 роки тому

      Fun to make too ;)

    • @markgoode9897
      @markgoode9897 2 роки тому

      @@CurbalEN first time with musical interlude?

    • @CurbalEN
      @CurbalEN  2 роки тому

      Nope, done a few times before, was it nice ?

    • @markgoode9897
      @markgoode9897 2 роки тому

      @@CurbalEN I missed some videos?! Yup - I’ll need to slow frame my way through. Will give it a go later this week

    • @CurbalEN
      @CurbalEN  2 роки тому

      I post too many 😂

  • @antique-bs8bb
    @antique-bs8bb 2 роки тому +1

    yes please - part 2 sounds v interesting

    • @CurbalEN
      @CurbalEN  2 роки тому

      It is similar, but even more powerful:)

  • @fayaflai
    @fayaflai Рік тому

    You are the absolute GOAT

  • @jasonyi6792
    @jasonyi6792 2 роки тому

    Great video! 2nd video please!

  • @nurulbasar8277
    @nurulbasar8277 2 роки тому

    great video,
    currently trying to call all available invoice pages from Xero(accounting tool). can't wait for next part.

    • @CurbalEN
      @CurbalEN  2 роки тому +1

      Yes, I will try to do it next week!

  • @impossibru28
    @impossibru28 2 роки тому

    I realize I'm a couple weeks late but I would love to see part 2!

  • @mikes6248
    @mikes6248 2 роки тому

    Thanks!

  • @rashmirana7861
    @rashmirana7861 2 роки тому +1

    Yes please do part 2

  • @abhijeetghosh27
    @abhijeetghosh27 2 роки тому

    Cool .. very good idea 👍👍

  • @tuyoexcelypowerbi
    @tuyoexcelypowerbi 2 роки тому

    Buen vídeo!!

  • @rkartau
    @rkartau 2 роки тому +2

    Hey Loved the video. Making it really easy to learn the stuff. I'd really love to get the second part of the video.
    The thing is that my company is usking JIRA and their API does not use this page nr system as you are showing and the table i need to process has 1150 rows, but jira is limiting it to 50 outputs per request. So as a result I think there is tone of people (many jira users) who'd love to get this second part as much as I do.

    • @byrongdrums8066
      @byrongdrums8066 2 роки тому

      I have the same issue in Pipedrive API, Did you solved it? Would be very helpful!!

    • @CurbalEN
      @CurbalEN  2 роки тому

      Here it is:
      m.ua-cam.com/video/05yhwnuCjRw/v-deo.html

    • @CurbalEN
      @CurbalEN  2 роки тому

      Here it is:
      m.ua-cam.com/video/05yhwnuCjRw/v-deo.html

  • @luukhilde4016
    @luukhilde4016 2 роки тому

    Hello, I get the message "Some data sources may not be listed because of hand-authored queries" when I open the data source settings. Any idea how I could fix this? I think this appears when I dynammically loop the query based on de column1 list

  • @waldof86
    @waldof86 2 роки тому +1

    I've had opportunity to do both this and another one where I don't know the amount of pages beforehand, but in both cases, my main issue is that it won't refresh in the service. I'd love a video on that if you have a solution. As always thank you for your amazing content!

    • @aCURLYproduction
      @aCURLYproduction 2 роки тому

      I have the exact same problem! I get to create the report but when I publish and try to schedule a refresh I get an errormessage

    • @CurbalEN
      @CurbalEN  2 роки тому +1

      Try this:
      m.ua-cam.com/video/fstsQMZiHME/v-deo.html

  • @TiesKuipers
    @TiesKuipers 2 роки тому

    Hi there,
    I was wondering how you could paginate an API with x pages and where the page ends with Next, mine keeps looping with this method, so I think my example needs another fix right?
    Could you help me with that?

  • @surender665
    @surender665 Рік тому

    Hi, I humble request you for getting suggestion how to import data in power bi from Apache druid . there is not direct connectivity option in power bi.

  • @mahathmasadineni2884
    @mahathmasadineni2884 2 роки тому

    Hi Madam. I just want to know is it possible in power query to get the data of all duplicates in a single row.

  • @windsurfreview
    @windsurfreview 2 місяці тому

    I'm running into a problem with the limits on the number of API calls I can maken (400 max per 5 minutes). Do you have any advice how I could solve this? Is there a way to pause the API calls?
    Thanks for all your videos Ruth. They helped numerous times already.

  • @prokocim
    @prokocim 2 роки тому +1

    great stuff! one question: since we have the dynamic number of pages in query 'country' do we need 'Query1' any more?

    • @CurbalEN
      @CurbalEN  2 роки тому +1

      No you don’t need it anymore :)

  • @johnyoung5164
    @johnyoung5164 2 роки тому

    Hello
    Long time viewer, first time caller, keep up the good work
    I have had a problem with this that I have encountered before using API but havent been able to solve, it is the dreaded "Formula.Firewall: Query 'Query2' (step 'Added Custom') references other queries or steps, so it may not directly access a data source. Please rebuild this data combination" error message
    There are examples online but none of them use Web.Contents, can you show me how to solve this?

  •  Рік тому

    How can I use Dataflows for this task? I always get a dynamic consult error when I try this trick.

  • @AnweshGangula
    @AnweshGangula 2 роки тому

    waiting for part-2

  • @quentinwinisdoerffer421
    @quentinwinisdoerffer421 2 роки тому

    Hey Ruth, Thank you for the tips. I couldn't try as the API isn't working (maybe because of firewall...) however i was wondering if you could schedule refresh in the Web Service. Often it gets the error that Dynamic queries are not supported (as least in Pro version without premium)

    • @CurbalEN
      @CurbalEN  2 роки тому

      You can if use RelativePath and Queries:
      m.ua-cam.com/video/fstsQMZiHME/v-deo.html

    • @quentinwinisdoerffer421
      @quentinwinisdoerffer421 2 роки тому

      @@CurbalEN I need to get deeper into that... Thanks a lot Ruth, as always :)

    • @CurbalEN
      @CurbalEN  2 роки тому

      My pleasure!

  • @sanoobarkhan1445
    @sanoobarkhan1445 2 роки тому

    How can I import data from JIRA server using rest Api.. please help

  • @debsicus
    @debsicus 2 роки тому +1

    I have an API that provides a next page key and count of records but says nothing about number of pages. How do I treat this?

    • @CurbalEN
      @CurbalEN  2 роки тому

      Coming up on how to fix unknown number of pages, stay tuned

    • @mirnakhoury8888
      @mirnakhoury8888 2 роки тому

      is this solution available?

    • @CurbalEN
      @CurbalEN  2 роки тому

      Yes:
      m.ua-cam.com/video/05yhwnuCjRw/v-deo.html

  • @murtazaulhasan
    @murtazaulhasan 2 роки тому

    Great Video!
    Can you also do a tutorial to create admin views? (Workspaces, user access, reports, datasets, etc) using REST APIs that refreshes dynamically? (Without having to hardcore your password in the query editor). TIA.

    • @CurbalEN
      @CurbalEN  2 роки тому

      You mean Power BI rest api?

    • @murtazaulhasan
      @murtazaulhasan 2 роки тому

      @@CurbalEN Yes please. Powerbi APIs. I am trying to create report from the thousands of workspaces that we have, which can help us manage the content, access/users, datasets etc

    • @CurbalEN
      @CurbalEN  2 роки тому

      With the time I have available at the moment, it is not on my priority list I am afraid. Working with APIs takes long time :(

    • @murtazaulhasan
      @murtazaulhasan 2 роки тому

      @@CurbalEN i understand. Thank you for replying.

  • @emiliag4070
    @emiliag4070 2 роки тому

    Hey Ruth, great timing :) because I have problem with that :) And I have a question for You or subscribers: will this solution work on PowerBI Server?

    • @CurbalEN
      @CurbalEN  2 роки тому

      Power BI server or service? It works on the service

    • @emiliag4070
      @emiliag4070 2 роки тому

      @@CurbalEN I mean PowerBI Report Server?

    • @emiliag4070
      @emiliag4070 2 роки тому

      I want to schedule refreshing on PowerBI Report Server and I get this message: "Scheduled Data Refresh is not available for reports. The report does not have any external data connections defined or is using an unsupported data source."

    • @CurbalEN
      @CurbalEN  2 роки тому

      Oh, the on-prem one. It should work, try it.

    • @CurbalEN
      @CurbalEN  2 роки тому +1

      I take it back:
      Report server does not allow dynamic data sources:
      Your report contains dynamic data sources. For example, data from the report is used to dynamicaly build the name of a server, the name of a database, or a URL address to fetch contents. Only data sources that are detected when the report was uploaded can be refreshed.

  • @SaniGarba
    @SaniGarba 2 роки тому

    Sooner🙂

  • @mrkraymnd
    @mrkraymnd Рік тому

    NOTE as of 10/5/22: This approach only works in PBI desktop and wont work once published to PBI Online. Refer to "dynamic data source" error.

    • @CurbalEN
      @CurbalEN  Рік тому +1

      Dynamic data source error refers to how the url is built not the list.numbers approach

    • @mrkraymnd
      @mrkraymnd Рік тому

      @@CurbalEN fair - would love to see how to fix the "data source error" :D

    • @CurbalEN
      @CurbalEN  Рік тому

      This might help:
      m.ua-cam.com/video/fstsQMZiHME/v-deo.html

  • @user-ji7mr2vc4p
    @user-ji7mr2vc4p 9 місяців тому

    you are not showing the whole page you have in powerbi and that makes it very hard to follow you.

    • @CurbalEN
      @CurbalEN  9 місяців тому

      Sorry, my editing skills are not the best at times :(

  • @eugeneo1589
    @eugeneo1589 2 роки тому +1

    Or you could use ?per_page=9999999 to obtain all the records in one result :)

    • @CurbalEN
      @CurbalEN  2 роки тому

      Oddly enough, you actually can do it with this API. Never seen it before 🤷‍♀️

    • @iliovininino
      @iliovininino Рік тому

      Love you so much, because I was lost and do not know what to do once the high speed of the video began cause there are some steps missing. I guess I need a brake from the computer.