Alteryx Designer Discussions

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

How to Iteratively use the Download tool

jeeva_ganesan
8 - Asteroid

Hi All,

 

I have just built a workflow to download information from an API (Contacts information). In the input tool, I pass the contact name and it will be appended in the download URL as a header as per my workflow. But now I am looking for options to automate this for multiple contacts. But for signature generation(authentication purpose), I need the workflow to read one contact name at a time, because signature will be generated for each contact name. How can we achieve this in alteryx? Ideally I am looking for an option to call the macro once for each input record.

 

Let me know for any details.

 

Thanks in advance.

Jeeva.

3 REPLIES 3
rdoptis
11 - Bolide

Hi Jeeva,

 

The Download tool works in something of a batch manner per record. If you were to have each row of your data contain a contact name, and have a column for the unique signature to put in the header, the download tool would process each row independently as its own API call. This would allow you to send a single configured download tool a long list of contacts, and it would make an API call for each.

 

That being said - what you described in your last sentance is a batch macro. These type of macros use something called a control parameter in their setup - this parameter defines what makes up a batch. For your use case, each "batch" would be a unique contact name to lookup. While this method could certainly be employeed for solving your issue, it is likely overkill since the Download tool already processes each record indpendently.

 

Here is more documentation on batch macros:

1) http://community.alteryx.com/t5/Engine-Works-Blog/Alteryx-Simple-Batch-Macros/ba-p/2251

2) Page 40 of this PDF guide: http://community.alteryx.com/t5/Alteryx-Knowledge-Base/Inspire-2015-Tips-amp-Tricks/ta-p/1132

 

 

Hope this helps, and post any further questions you may have!

 

 

Regards,

Ryan

 

 

Aguisande
14 - Magnetar
14 - Magnetar

I totally agree on this one. 99.9% of the times, what we think is an interative macro, ends up being a batch macro.

 

But of course, as everything in Alteryx, you have a lot of ways to solve any "business problem". In the case you still need to generate a request for each contact, maybe the Dynamic set of tools will help you.

Best,

_AG_ 

jeeva_ganesan
8 - Asteroid

Thanks all for the reply. Yes Download tool does that each record at a time. But I am generating the signature in python script(inside the macro) and it has to be done for each record separately. I wanted to bring in own record at a time to the macro. Since all the records are brought in at once, signature creation was not working. Now after your reply, I changed the workflow to run the python script(using command tool) in the main workflow not inside the macro, so now am passing all the records once to the macro(with the last column having signature for that record). Now this should be handled by the download tool. Let me try this and get back. Thanks again.

Labels