HI,
I'm trying to create a looping Macro to download API data from an list of API addresses. The interface accepts a set of 10 nodes at the time so I would like to convert the data to set of 10 nodes. Does anyone have a good idea how to do this?
Datatable is in the following format:
And it should be translated into the following (API request URL):
https://google.com/1, 2, 3, 4 5, 6, 7, 8, 9, 10 | |
https://google.com/11,12,13,14,15,16,17,18,19,20 | |
https://google.com/21,22,23,24,25,26 |
Second question is how to convert it into a looping macroto pull the data out in one go? I tested the iterative Macro, but for some reason, I could not get it to work 😞
Thanks!! 😃
Solved! Go to Solution.
Hi @JarkkoP
You can pass all the URLs in one go in the download tool it process URL in each row hence you should be getting data for all 3 requests.
Hope this helps : )
Hi @JarkkoP
You don't need an iterative macro. The Download tool can take care of one call per row for you.
Here's a way to do it.
You can generate rows to create as many calls you want (in this case, 26). Then you can split in tiles of 10 by using the Mod Function and the Multi-Row Formula.
It's a matter of concatenating them using the summarizing tool and grouping by tile. Just send that to the download tool and it will be fine.
Cheers,
HI Thabelaus! Thanks for the quick response! My example was a bit bad, apologies for that. the number of nodes can change on every request, and the numbers are not in the form of1-26. the node IDs can be anything from 14673 to 95765, totally random numbers.
This helps, thanks atcodedog! I didnt realise I can pass them as seperate URLs to the download tool. Only thing im still struggling is how to divide them to sets of 10.
Use the example I just showed. It's a matter of adding a RecordID (instead of generate rows) and using the MultiRow Formula with the Mod Function to split in the appropriate buckets of 10.
Cheers,
I did, but its not working correctly. Whenever I have more data in the source, its messing the results 😞
Thanks!
In this case you should add a RecordID and use the RecordID as the field to create the tiles with the MultiRowFormula tool.
Add a Record ID after the Generate Rows tool. Only use that Record ID to create the tiles, the Field you concatenate should be your "Field2" as you're doing now.
I was a bit slow on understanding that one ;=) It's working now! :=)
Thanks a lot!