Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Iterative API Macro Different Number of records on each run

harinder1301
8 - Asteroid

Hi,

I am using Iterative Macro to download the records from API in Json format and I need to call the macro 3-4 times to get the correct number of iterations and number of records. If I call the same macro with same URL again and again it gives different results such as exact whole number of records like 1000,2000,5000,7000 etc randomly each time .

For example:

I am expecting "TotalCount":14707,"TotalPages":15

First time when i call the Macro i have received  2000 records and 1 iteration 

harinder1301_0-1643717436520.png

2nd time 11000 records and 10 iterations

harinder1301_1-1643717581735.png

and so on .. and received the correct number of records after several attempts.

I have tried throttle records , records per minute :25 and maximum connections :2 in the download tool connections settings. But, still no luck.

Appreciate your advise on this.

Thanks

Hsac

 

9 REPLIES 9
TheOC
15 - Aurora
15 - Aurora

hi @harinder1301,
Is this a public API? Are you able to share the tool/workflow at all so i can investigate on my side?

Thanks,
TheOC


Bulien
gabrielvilella
14 - Magnetar

Hi @harinder1301, if you open the macro and run the first iteration there, do you get different results each time as well?

harinder1301
8 - Asteroid

Thanks for the reply. It is not public API.

It displays 1000 records only when i run this Macro directly and random records when i call it from an another standard macro.

 

gabrielvilella
14 - Magnetar

Try inserting a Browse tool on both output anchors of the macro and see if you still get different results each time. 

harinder1301
8 - Asteroid

Yes,It is still giving the same number of records .

gabrielvilella
14 - Magnetar

How it's determined the number of times the macro will run? Is it based on the number of pages? If so, maybe try to investigate if the API is returning the correct number of pages.

harinder1301
8 - Asteroid

Yes, loop is based on the Nextpagelink. It was working ok till December 2021.

 

X-Pagination: {"TotalCount":14707,"TotalPages":15,"PrevPageLink":"","NextPageLink":"https://website...&pagesize=1000&pageNumber=1"}

 

harinder1301_0-1643728623682.png

 

TheOC
15 - Aurora
15 - Aurora

hey @harinder1301 

Do you happen to be using AMP engine?

Cheers,
TheOC


Bulien
harinder1301
8 - Asteroid

Thank you everyone for your help. There was an invalid character in Downloaded Header sometime. It is fixed now.

 

Labels