Iterative API Macro Different Number of records on each run
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
2nd time 11000 records and 10 iterations
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @harinder1301, if you open the macro and run the first iteration there, do you get different results each time as well?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Try inserting a Browse tool on both output anchors of the macro and see if you still get different results each time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Yes,It is still giving the same number of records .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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"}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
hey @harinder1301
Do you happen to be using AMP engine?
Cheers,
TheOC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you everyone for your help. There was an invalid character in Downloaded Header sometime. It is fixed now.


