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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Saadii_360o
Helper I
Helper I

Power BI Pagination & Looping using List.Generate

Hi everyone. I am posting again because could'nt find my solution.
ISSUE:

URL: https://vcc-na8.8x8.com/api/stats/agents//agents/{agent-id}/activities?n={offset}

As you can see in above URL that I have to add agent id every single time and this API provides 50 rows per request.
NOTE: API does not provide any information on count etc
With help of @mahoneypat  I was able to create a function which allows me to extract all id's along with the pagination, PFB,

(id as text)=>

let

Source =

List.Generate( ()=>[result = try Xml.Tables(Web.Contents("https://vcc-na8.8x8.com",[RelativePath="/api/stats/agents/"&(id)&"/activities?n=1"])) otherwise null, n=1],


each [result]<> null,

 

each [result = try Xml.Tables(Web.Contents("https://vcc-na8.8x8.com",[RelativePath="/api/stats/agents/"&(id)&"/activities?n="&Number.ToText([n]+50)])) otherwise null, n=[n]+50],

each [result])

in

Source


Issue with the function:
1.Function is providing infinite tables. it is on constant loop I think.

Saadii_360o_0-1646821757765.png

 

2. When i try to invoke this function with Agent id's from new table it only formats the table with the first ID which is empty and provides null values.

Saadii_360o_1-1646821787693.png

 


3. It is on constant load. does'nt do anything.

Saadii_360o_2-1646821786980.png

 


PFB the link to my video which i have created for the better understanding. It will save your time to provide the solution.

Link: https://drive.google.com/file/d/1xbASl1EaziV3qp1ptZlzCtA-fbXnbJ3R/view?usp=sharing

API Documentation: https://support.8x8.com/cloud-contact-center/virtual-contact-center/developers/8x8-contact-center-st...

Requirment: Looking for a function which provides all the id's with all the rows(Pagination).


Really looking forward for someone's help.

Best,
Saad.

1 REPLY 1
V-lianl-msft
Community Support
Community Support

Hi @Saadii_360o ,


After watching the videos and formulas you provided many times, it is difficult to find out the specific issue. Unfortunately, I can't go deep into the issue because of the website needs to log in and cannot be registered, this may involve your privacy information. It is recommended that you create a support ticket for further help.

https://community.powerbi.com/t5/Community-Blog/How-to-create-a-support-ticket-in-Power-BI/ba-p/6830... 


Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.