This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
I have the below code:
Pages = List.Generate(() =>
CallAPI(endpoint, "1"),
each HasContToken(Value.Metadata(_)),
each try CallAPI(
endpoint,
Text.Split(Text.Split(Value.Metadata(_)[next_page], "?page="){1}, "&"){0}
)
otherwise null
),
I know the condition step is checking if certain metadata exists. That works well for my final query. But for testing purposes, I don't want it to loop until the check for metadata returns false. I just want it to loop say x amount of times and then finish.
I tried changing the condition to each _ <10 but it just spins at evaluating when executing.
Hi there,
Try something along these lines:
Pages = List.Generate(
() => [APIResult = CallAPI(endpoint, "1"), Counter = 1],
each [Counter] < 10,
each
[
APIResult =
try CallAPI(
endpoint,
Text.Split(Text.Split(Value.Metadata([APIResult])[next_page], "?page="){1}, "&"){0}
)
otherwise null,
Counter = [Counter] + 1
],
each [APIResult]
),
Hopefully the above works and I haven't made syntax errors!
Regards,
Owen
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 27 | |
| 25 | |
| 22 | |
| 20 | |
| 14 |
| User | Count |
|---|---|
| 51 | |
| 47 | |
| 23 | |
| 18 | |
| 18 |