Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Conditional call many api trought next page key and making a list

Hi,

 

it's my first time on the community 🙂 though it's not my first time working with Power Query. Hi to every Power Query (and Excel) lover. As of today I've learned pretty much everything I did by reading here. I'm going trought a use case that I would consider pretty hard and for this reason I reach for your help here.

 

1. My data source comes from an API Call:
https://dynatrace.domain.it/e/tenantid/api/v2/problems?Api-Token=xxxxxxxxxxxxxxxxxxxx&pageSize=500&f...

2. When the api get downloaded I got the following dataset > with this first Api call I have a subset of data; the value in "nextPageKey" is the value that I need to imput in order to extract the subsequent subset of data :

 

usecase1.png

 

 

 

 

 

3. In order to make the subsequent call the api will take this shape:
https://dynatrace.domain.it/e/tenantid/api/v2/problems?Api-Token=xxxxxxxxxxxxxxxxxxxx&nextPageKey=AQ....

My final goal is to loop those api call so I can have a full list of "nextPageKey" values. After I have the full list of the possibile nextPageKey, I'll call it in order to have a full table of the "problems" field.

I have read about List.Generate and I have seen many example of incremental loop (by setting a function) but in my case the nextPageKey is an alphanumeric that is only generate after each subsequent api call.


Thank you for your time a patience

2 REPLIES 2
dmartins3103
New Member

Hi,

 

I have the same problem, did you manage to find the solution?

lbendlin
Super User
Super User

List.Generate is still the right thing to do here (assuming that your browser cache can absorb the cost of calling each page twice).  What have you tried and where are you stuck?

 

It is close to impossible to assist with API questions without access to the API.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.