Paginated Requests - Power BI

Solved
RobertCo
New Member
4 0 0

Hi,

 

I was hoping someone could offer up a solution to the problem that we’re having with our current integration of Power BI with the changes to pagination or offer an alternative solution that we could use.

 

At the moment, we’re pulling in data from our Shopify store using API access from a private app we’ve setup, using the ‘Web’ data source in Power BI. The individual requests might look something like:

https://{API_KEY}:{PASSWORD}@{STORE_NAME}.myshopify.com/admin/orders.json?limit=250

 

However for many of our tables we have results exceeding 250, in which case we use multiple pages. Effectively, we string together multiple web sources and form them into a single table than can then be manipulated in Power Bi. In the case of the orders table this might look like:

https://{API_KEY}:{PASSWORD}@{STORE_NAME}.myshopify.com/admin/orders.json?limit=250&page=1

https://{API_KEY}:{PASSWORD}@{STORE_NAME}.myshopify.com/admin/orders.json?limit=250&page=2

https://{API_KEY}:{PASSWORD}@{STORE_NAME}.myshopify.com/admin/orders.json?limit=250&page=3

https://{API_KEY}:{PASSWORD}@{STORE_NAME}.myshopify.com/admin/orders.json?limit=250&page=4

https://{API_KEY}:{PASSWORD}@{STORE_NAME}.myshopify.com/admin/orders.json?limit=250&page=5

 

Looking at the new documentation on this: https://shopify.dev/tutorials/make-paginated-requests-to-rest-admin-api , I can’t see any obvious replacement for this method of pulling data.

 

Can anyone suggest how we might work in the above manner using Power BI with these updates or suggest any alternatives?

 

Thank you

 

0 Likes
SBD_
Shopify Staff
Shopify Staff
1071 143 189

This is an accepted solution.

Hey @RobertCo,

 

From your example, the first request is still suitable:

 

https://{STORE_NAME}.myshopify.com/admin/orders.json?limit=250


But consider hitting the /api/ endpoint and sending an access token instead of key:password:

https://{STORE_NAME}.myshopify.com/admin/api/2020-01/products.json?limit=250


From there, check the headers of the response for the link header, it will look something like this:

link: <https://...myshopify.com/admin/api/2020-01/products.json?limit=250&page_info=abcd1234...>; rel="next"


Follow the 'next' link for the next page of results.

0 Likes
Alpha_Serve
New Member
1 0 0

Hi @RobertCo 

If you still have issues pulling data from Shopify to Power BI you might want to try our Power BI Connector for Shopify https://apps.shopify.com/power-bi-connector-1.

We'll be happy to help you with the integration, also there's a free plan available.

Thank you.

Best regards,

Alpha Serve Team

0 Likes